TensorRT
TensorRT copied to clipboard
đ [Bug] Torch_tensorrt compile doesnât support pretrained torchvision Mask_RCNN model.
Bug Description
Torch_tensorrt compile doesnât support pretrained torchvision Mask_RCNN model. Error: RuntimeError: temporary: the only valid use of a module is looking up an attribute but found = prim::SetAttr[name=â_has_warnedâ](%self, %178) :
To Reproduce
Steps to reproduce the behavior:
- Please execute the .ipynb notebook attached below https://drive.google.com/file/d/1nN95csu4r9KQJhH8XaryGFYdBPiAKlqm/view
Expected behavior
Expected the pretained mask rcnn model from the torchvision module to compile.
Environment
Build information about Torch-TensorRT can be found by turning on debug messages
- TensorRT Version: 1.2.0a0
- GPU Type: GeForce RTX 3070
- Nvidia Driver Version: 470.141.03
- CUDA Version: 11.4
- Operating System + Version: Ubuntu 20.04
- Python Version (if applicable): 3.8.13
- TensorFlow Version (if applicable): -
- PyTorch Version (if applicable): 1.13.0a0+08820cb
- How you installed PyTorch (
conda,pip,libtorch, source): pip [pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116] - Baremetal or Container (if container which image + tag): Nvidia NGC Container [nvcr.io/nvidia/pytorch:22.07-py3]
Iâm getting the same type of error for a custom model.
I am having similer issue too.
File "/home/ainl/anaconda3/envs/torch/lib/python3.8/site-packages/torch_tensorrt/_compile.py", line 125, in compile
return torch_tensorrt.ts.compile(
File "/home/ainl/anaconda3/envs/torch/lib/python3.8/site-packages/torch_tensorrt/ts/_compiler.py", line 136, in compile
compiled_cpp_mod = _C.compile_graph(module._c, _parse_compile_spec(spec))
RuntimeError:
temporary: the only valid use of a module is looking up an attribute but found = prim::SetAttr[name="center"](%c2.53, %8)
:
However my torch.jit.script dump doesn't not have prim::SetAttr[name="center"](%c2.53, %8).
model_ft = model
lr_curr = torch.empty((1, 1, 4, 540, 960), dtype=torch.float32, device=device)
traced_model = torch.jit.script(model_ft, (lr_curr))
model = traced_model
f_s_m = torch._C._freeze_module(traced_model._c)
f_s_m.dump()
Getting the same error if I try to convert simple Mask RCNN, although torch.jit.script() works fine.
This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days
This issue has not seen activity for 90 days, Remove stale label or comment or this will be closed in 10 days