facebookresearch / maskrcnn-benchmark

Fast, modular reference implementation of Instance Segmentation and Object Detection algorithms in PyTorch.
MIT License
9.3k stars 2.49k forks source link

libtorch.so.1: undefined symbol: #149

Open rookiecm opened 6 years ago

rookiecm commented 6 years ago

❓ 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 commented 6 years ago

environment: Ubuntu 14.04 Pytorch 1.0 cuda 8.0.61 cuDNN 6.0.21

fmassa commented 6 years ago

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
rookiecm commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

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