Error when torch.load() model, libcaffe2_nvrtc.so not found

Dear all,

I tried to load a pre-train model saved in *.pth by using torch.load().
It always return RuntimeError: Error in dlopen or dlsym: libcaffe2_nvrtc.so: cannot open shared object file: No such file or directory
I tried to export path as in RuntimeError: Error in dlopen or dlsym: libcaffe2_nvrtc.so: cannot open shared object file: No such file or directory · Issue #31554 · pytorch/pytorch · GitHub, still the same error.
Even I changed directory to the folder which has the file libcaffe2_nvrtc.so, it still report same error.

./ libcaffe2_detectron_ops_gpu.so* libshm.so*
…/ libcaffe2_module_test_dynamic.so* libtorch.so*
libc10.so* libcaffe2_nvrtc.so* libtorch_python.so*
libc10_cuda.so* libcaffe2_observers.so*

I used torch version 1.3.1 installed in a linux conda environment.

1 Like

@sonnguyen have you find a solution?

Yes, kind of. I upgraded it to PyTorch 1.4 and problem solved.

I’m having the same issue appearing under different circumstances: it happens only when I try to run a script from the terminal using CUDA. If I don’t the script runs fine.

I am running:

pytorch 1.4.0 py3.7_cuda10.1.243_cudnn7.6.3_0
Linux 5.6.13