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

AttributeError: 'torch.device' object has no attribute 'gpu_id' #8050

Closed
KumoLiu opened this issue Aug 28, 2024 · 0 comments · Fixed by #8051
Closed

AttributeError: 'torch.device' object has no attribute 'gpu_id' #8050

KumoLiu opened this issue Aug 28, 2024 · 0 comments · Fixed by #8051
Labels
bug Something isn't working

Comments

@KumoLiu
Copy link
Contributor

KumoLiu commented Aug 28, 2024

17:11:34  Traceback (most recent call last):
17:11:34    File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
17:11:34      return _run_code(code, main_globals, None,
17:11:34    File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
17:11:34      exec(code, run_globals)
17:11:34    File "/home/jenkins/agent/workspace/Test-Monai-latest-image/monai/bundle/__main__.py", line 31, in <module>
17:11:34      fire.Fire()
17:11:34    File "/usr/local/lib/python3.10/dist-packages/fire/core.py", line 143, in Fire
17:11:34      component_trace = _Fire(component, args, parsed_flag_args, context, name)
17:11:34    File "/usr/local/lib/python3.10/dist-packages/fire/core.py", line 477, in _Fire
17:11:34      component, remaining_args = _CallAndUpdateTrace(
17:11:34    File "/usr/local/lib/python3.10/dist-packages/fire/core.py", line 693, in _CallAndUpdateTrace
17:11:34      component = fn(*varargs, **kwargs)
17:11:34    File "/home/jenkins/agent/workspace/Test-Monai-latest-image/monai/bundle/scripts.py", line 1729, in trt_export
17:11:34      _export(
17:11:34    File "/home/jenkins/agent/workspace/Test-Monai-latest-image/monai/bundle/scripts.py", line 1297, in _export
17:11:34      net = converter(model=net, **kwargs)
17:11:34    File "/home/jenkins/agent/workspace/Test-Monai-latest-image/monai/networks/utils.py", line 965, in convert_to_trt
17:11:34      trt_model = _onnx_trt_compile(
17:11:34    File "/home/jenkins/agent/workspace/Test-Monai-latest-image/monai/networks/utils.py", line 852, in _onnx_trt_compile
17:11:34      trt_model = torch_tensorrt.ts.embed_engine_in_new_module(
17:11:34    File "/usr/local/lib/python3.10/dist-packages/torch_tensorrt/ts/_compiler.py", line 320, in embed_engine_in_new_module
17:11:34      _parse_device(device),
17:11:34    File "/usr/local/lib/python3.10/dist-packages/torch_tensorrt/ts/_compile_spec.py", line 90, in _parse_device
17:11:34      return TorchScriptDevice._from(device_info)._to_internal()
17:11:34    File "/usr/local/lib/python3.10/dist-packages/torch_tensorrt/ts/_Device.py", line 66, in _from
17:11:34      gpu_id=d.gpu_id,
17:11:34  AttributeError: \'torch.device\' object has no attribute \'gpu_id\'
@KumoLiu KumoLiu added the bug Something isn't working label Aug 28, 2024
KumoLiu added a commit to KumoLiu/MONAI that referenced this issue Aug 28, 2024
Signed-off-by: YunLiu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant