[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range #81

Open
mdymxy opened this issue Mar 26, 2023 · 1 comment
Open

IndexError: list index out of range #81

mdymxy opened this issue Mar 26, 2023 · 1 comment
Assignees

Comments

@mdymxy
Copy link
mdymxy commented Mar 26, 2023

Bug description

Traceback (most recent call last):
  File "D:/python/flops/cs3.py", line 5, in <module>
    summary(model, (3, 224, 224), max_depth=2)
  File "D:\ProgramData\Anaconda3\envs\torch10\lib\site-packages\torchscan\crawler.py", line 297, in summary
    module_info = crawl_module(module, input_shape)
  File "D:\ProgramData\Anaconda3\envs\torch10\lib\site-packages\torchscan\crawler.py", line 62, in crawl_module
    cuda_overhead = get_process_gpu_ram(os.getpid()) - (torch.cuda.memory_reserved() / 1024**2)
  File "D:\ProgramData\Anaconda3\envs\torch10\lib\site-packages\torchscan\process\memory.py", line 49, in get_process_gpu_ram
    if ram_str[1].startswith("process"):
IndexError: list index out of range

Code snippet to reproduce the bug

from torchvision.models import densenet121
from torchscan import summary

model = densenet121().eval().cuda()
summary(model, (3, 224, 224), max_depth=2)

Error traceback

Traceback (most recent call last):
  File "D:/python/flops/cs3.py", line 5, in <module>
    summary(model, (3, 224, 224), max_depth=2)
  File "D:\ProgramData\Anaconda3\envs\torch10\lib\site-packages\torchscan\crawler.py", line 297, in summary
    module_info = crawl_module(module, input_shape)
  File "D:\ProgramData\Anaconda3\envs\torch10\lib\site-packages\torchscan\crawler.py", line 62, in crawl_module
    cuda_overhead = get_process_gpu_ram(os.getpid()) - (torch.cuda.memory_reserved() / 1024**2)
  File "D:\ProgramData\Anaconda3\envs\torch10\lib\site-packages\torchscan\process\memory.py", line 49, in get_process_gpu_ram
    if ram_str[1].startswith("process"):
IndexError: list index out of range

Environment

python 3.8.16
torch 1.13.1+cu116
torchaudio 0.13.1+cu116
torchscan 0.1.2
torchtoolbox 0.1.8.2
torchvision 0.14.1+cu116

@mdymxy mdymxy added the bug Something isn't working label Mar 26, 2023
@frgfm
Copy link
Owner
frgfm commented Jan 27, 2024

Hey @mdymxy 👋

Very sorry about the late reply, looks like I triaged the issue and forgot to reply. Are you still able to reproduce the crash?

On my end with your snippet, using the current version, the snippet runs perfectly 👌

@frgfm frgfm added awaiting response and removed bug Something isn't working labels Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants