Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

libtorch.so.1: undefined symbol: #149

Open
rookiecm opened this issue Nov 13, 2018 · 10 comments
Open

libtorch.so.1: undefined symbol: #149

rookiecm opened this issue Nov 13, 2018 · 10 comments
Labels
question Further information is requested

Comments

@rookiecm
Copy link

❓ Questions and Help

When I execute the command 'python setup.py build develop' in the Installation.md. I got the following mistakes:
Traceback (most recent call last):
File "setup.py", line 7, in
import torch
File "/home/caomeng/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/init.py", line 84, in
from torch._C import *
ImportError: /home/caomeng/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/lib/libtorch.so.1: undefined symbol: _ZTIN2at10TensorImplE
(maskrcnn_benchmark) caomeng@adsplab-vision:~/github/maskrcnn-benchmark$ python setup.py build develop
Traceback (most recent call last):
File "setup.py", line 7, in
import torch
File "/home/caomeng/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/init.py", line 84, in
from torch._C import *
ImportError: /home/caomeng/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/lib/libtorch.so.1: undefined symbol: _ZTIN2at10TensorImplE

@rookiecm
Copy link
Author

environment:
Ubuntu 14.04
Pytorch 1.0
cuda 8.0.61
cuDNN 6.0.21

@fmassa
Copy link
Contributor

fmassa commented Nov 13, 2018

Hi,

This generally happens when your PyTorch installation is not the same as the one you used to build maskrcnn-benchmark.

Try doing the following:

import torch
print(torch.__version__)

and see if it is indeed a 1.0 release of PyTorch.

Also, please copy and paste the output from the
environment collection script from PyTorch
(or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
  • PyTorch Version (e.g., 1.0):
  • OS (e.g., Linux):
  • How you installed PyTorch (conda, pip, source):
  • Build command you used (if compiling from source):
  • Python version:
  • CUDA/cuDNN version:
  • GPU models and configuration:
  • Any other relevant information:

@fmassa fmassa added the question Further information is requested label Nov 13, 2018
@rookiecm
Copy link
Author

Thank you. Actually, I create a new environment using conda and install pytorch just following the instruction in the INSTALL.md. I used to use pytorch0.4.1. But when I try to print the version of pytorch, I got the same mistake.

@fmassa
Copy link
Contributor

fmassa commented Nov 13, 2018

Do you mean that you are obtaining 0.4.1 when you do print(torch.__version__)?
If that's the case, then there is a conflict in your environment.

@rookiecm
Copy link
Author

Sorry, I didn’t express it clearly. I got the same mistake as I posted when I do print(torch.__version__) in the environment of pytorch1.0.

@fmassa
Copy link
Contributor

fmassa commented Nov 14, 2018

Can you try uninstalling maskcnn-benchmark and install it again? Don't forget to rm -rf build/ folder.
Also, what is the output of print(torch.__version__), it gives the date as well if it's 1.0, so that I check if there is a bug in that particular version of pytorch

@rookiecm
Copy link
Author

When I try to import torch, here comes the following errors:
Traceback (most recent call last):
File "", line 1, in
File "/home/caomeng/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages/torch/init.py", line 84, in
from torch._C import *
ImportError: /home/caomeng/anaconda2/lib/libgio-2.0.so.0: undefined symbol: g_type_check_instance_is_fundamentally_a

@fmassa
Copy link
Contributor

fmassa commented Nov 19, 2018

You seem to have an old pytorch installation laying around that is mixing up symbols, see that you have two anacondas,

/home/caomeng/anaconda3/

and

 /home/caomeng/anaconda2/

And one is picking files from the other.

@rookiecm
Copy link
Author

Sorry for replying late. I have removed Anaconda3. However, I still got errors as follows when I try to import torch.
Traceback (most recent call last):
File "", line 1, in
File "/home/caomeng/anaconda2/envs/pytorch1.0/lib/python3.7/site-packages/torch/init.py", line 84, in
from torch._C import *
ImportError: /home/caomeng/anaconda2/envs/pytorch1.0/bin/../lib/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var

@fmassa
Copy link
Contributor

fmassa commented Nov 22, 2018

that looks like a bugged install, where probably your anaconda2 was depending on anaconda3?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants