MVIG-SJTU / AlphAction

Spatio-Temporal Action Localization System
407 stars 74 forks source link

ImportError: libtorch_cpu.so #10

Closed FromSingularity closed 4 years ago

FromSingularity commented 4 years ago

Thanks for your sharing! I installed as prompted by the installation script. But when I run the demo.py,i got the following error:

import AlphAction.custom_ext as _C ImportError: libtorch_cpu.so: cannot open shared object file: No such file or directory

Can you help me ?

yelantf commented 4 years ago

Hi, thanks for your attention! This seems to be related to the version of PyTorch (see https://github.com/pytorch/pytorch/issues/38090). Could you please provide the output of the following command? python -c 'from torch.utils.collect_env import main; main()

FromSingularity commented 4 years ago

Hi, thanks for your attention! This seems to be related to the version of PyTorch (see pytorch/pytorch#38090). Could you please provide the output of the following command? python -c 'from torch.utils.collect_env import main; main()

The command output is as follows:

Collecting environment information... PyTorch version: 1.4.0 Is debug build: No CUDA used to build PyTorch: 10.1

OS: CentOS Linux release 7.4.1708 (Core) GCC version: (GCC) 8.3.0 CMake version: version 2.8.12.2

Python version: 3.7 Is CUDA available: Yes CUDA runtime version: 10.2.89 GPU models and configuration: GPU 0: GeForce GTX 1080 Ti GPU 1: GeForce GTX 1080 Ti

Nvidia driver version: 450.57 cuDNN version: /usr/local/cuda-10.2/targets/x86_64-linux/lib/libcudnn.so.7.6.5

Versions of relevant libraries: [pip3] numpy==1.19.1 [pip3] torch==1.4.0 [pip3] torchvision==0.5.0 [conda] blas 1.0 mkl [conda] mkl 2020.1 217 [conda] mkl-service 2.3.0 py37he904b0f_0 [conda] mkl_fft 1.1.0 py37h23d657b_0 [conda] mkl_random 1.1.1 py37h0573a6f_0 [conda] pytorch 1.4.0 py3.7_cuda10.1.243_cudnn7.6.3_0 pytorch [conda] torchvision 0.5.0 py37_cu101 pytorch

Is anything wrong?

yelantf commented 4 years ago

It shows that the version of CUDA used to build this project is 10.2, while the PyTorch installed is for CUDA10.1. The version of CUDA should be consistent. Please try either of the following and rebuild AlphAction:

Hope this could solve your problem.

FromSingularity commented 4 years ago

It shows that the version of CUDA used to build this project is 10.2, while the PyTorch installed is for CUDA10.1. The version of CUDA should be consistent. Please try either of the following and rebuild AlphAction:

  • Reinstall pytorch 1.4.0 for CUDA10.2
  • Replace your system CUDA with CUDA10.1, you can check which version is used by running command nvcc --version.

Hope this could solve your problem.

Thanks for your help. I changed the CUDA version in my system and rebuilt the project. CUDA version used to build and run is 10.1

CUDA used to build PyTorch: 10.1
CUDA runtime version: 10.1.243

But it doesn't seem to work. I get the same problem when I run the demo.py.

    import AlphAction.custom_ext as _C
ImportError: libtorch_cpu.so: cannot open shared object file: No such file or directory
yelantf commented 4 years ago

Thanks for your help. I changed the CUDA version in my system and rebuilt the project. CUDA version used to build and run is 10.1

CUDA used to build PyTorch: 10.1
CUDA runtime version: 10.1.243

But it doesn't seem to work. I get the same problem when I run the demo.py.

    import AlphAction.custom_ext as _C
ImportError: libtorch_cpu.so: cannot open shared object file: No such file or directory

This is weird. How did you rebuild this whole project? Did you remove the build/ directory before you do the rebuilding?

FromSingularity commented 4 years ago

Thanks for your help. I changed the CUDA version in my system and rebuilt the project. CUDA version used to build and run is 10.1

CUDA used to build PyTorch: 10.1
CUDA runtime version: 10.1.243

But it doesn't seem to work. I get the same problem when I run the demo.py.

    import AlphAction.custom_ext as _C
ImportError: libtorch_cpu.so: cannot open shared object file: No such file or directory

This is weird. How did you rebuild this whole project? Did you remove the build/ directory before you do the rebuilding?

I tried again and things went well. Thank you sooo much!