TensorRT icon indicating copy to clipboard operation
TensorRT copied to clipboard

Error when I'm trying to use torch-tensorrt

Open EstherMalam opened this issue 3 years ago • 3 comments

❓ Question

Hi I'm trying to use torch-tensorrt with the pre built ngc container

I built it with 22.04 branch and with 22.04 version of ngc My versions are: cuda 10.2 torchvision 0.13.1 torch 1.12.1

But I get that error: Traceback (most recent call last): File "main.py", line 31, in import torch_tensorrt File "/usr/local/lib/python3.8/dist-packages/torch_tensorrt/init.py", line 11, in from torch_tensorrt._compile import * File "/usr/local/lib/python3.8/dist-packages/torch_tensorrt/_compile.py", line 2, in from torch_tensorrt import _enums File "/usr/local/lib/python3.8/dist-packages/torch_tensorrt/_enums.py", line 1, in from torch_tensorrt._C import dtype, DeviceType, EngineCapability, TensorFormat ImportError: /usr/local/lib/python3.8/dist-packages/torch_tensorrt/lib/libtorchtrt.so: undefined symbol: _ZNK3c1010TensorImpl36is_contiguous_nondefault_policy_implENS_12MemoryFormatE

Thank's!!

EstherMalam avatar Aug 30 '22 13:08 EstherMalam

How is your WORKSPACE configured? If you are using PyTorch 1.12.1 not sure 22.04 is the right branch to use.

narendasan avatar Aug 30 '22 18:08 narendasan

My torch version is: 1.12.1, So what the right branch for me?

Thank's!!

EstherMalam avatar Aug 31 '22 06:08 EstherMalam

Hi,

Please refer the PyTorch release page for NGC here: https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/index.html

I am also curious as the error logs shows: /usr/local/lib/python3.8/dist-packages/torch_tensorrt/lib/libtorchtrt.so

Inside the NGC container the path for torch_tensorrt package is at: /opt/conda/... as mentioned here:

https://github.com/pytorch/TensorRT/blob/master/docker/WORKSPACE.ngc#L36

Are you sure you are running inside the container OR are you using any virtual env inside the container?

andi4191 avatar Sep 01 '22 07:09 andi4191