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

ImportError: libtorch_cpu.so #10

Closed
FromSingularity opened this issue Aug 7, 2020 · 6 comments
Closed

ImportError: libtorch_cpu.so #10

FromSingularity opened this issue Aug 7, 2020 · 6 comments
Assignees
Labels
good first issue Good for newcomers installation Installation failed

Comments

@FromSingularity
Copy link

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
Copy link
Collaborator

yelantf commented Aug 7, 2020

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()

@yelantf yelantf self-assigned this Aug 7, 2020
@yelantf yelantf added the more details wanted Need more detailed information label Aug 7, 2020
@FromSingularity
Copy link
Author

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
Copy link
Collaborator

yelantf commented Aug 8, 2020

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.

@FromSingularity
Copy link
Author

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
Copy link
Collaborator

yelantf commented Aug 9, 2020

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
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers installation Installation failed
Projects
None yet
Development

No branches or pull requests

2 participants