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

Import Error: Ransac Voting Layer - undefined symbo #18

Closed
Lynne-Zheng-Linfang opened this issue Mar 26, 2020 · 4 comments
Closed

Import Error: Ransac Voting Layer - undefined symbo #18

Lynne-Zheng-Linfang opened this issue Mar 26, 2020 · 4 comments
Labels
question Further information is requested

Comments

@Lynne-Zheng-Linfang
Copy link

Hi, I followed the instructions to do the training, however, the code terminated with the following error:

Exception has occurred: ImportError
/home/linfang/Documents/Code/HybridPose/lib/ransac_voting_gpu_layer/ransac_voting.so: undefined symbol: _ZN6caffe26detail37_typeMetaDataInstance_preallocated_32E
  File "/home/linfang/Documents/Code/HybridPose/lib/ransac_voting_gpu_layer/ransac_voting_gpu.py", line 3, in <module>
    import lib.ransac_voting_gpu_layer.ransac_voting as ransac_voting
  File "/home/linfang/Documents/Code/HybridPose/trainers/coretrainer.py", line 10, in <module>
    from lib.ransac_voting_gpu_layer.ransac_voting_gpu import ransac_voting_layer_v3
  File "/home/linfang/Documents/Code/HybridPose/src/train_core.py", line 12, in <module>
    from trainers.coretrainer import CoreTrainer

When I was compiling the Ransac Voting Layer, there was a warning about the torch C++ extension. I tried to add #include <torch/extrension.h> into ransac_voting.cpp, but it didn't work. It seems that the error is related to the version of Pytorch, could you please share the torch version?

running build_ext
building 'ransac_voting' extension
gcc -pthread -B /home/linfang/anaconda3/envs/hybridpose/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/linfang/anaconda3/envs/hybridpose/lib/python3.7/site-packages/torch/include -I/home/linfang/anaconda3/envs/hybridpose/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/linfang/anaconda3/envs/hybridpose/lib/python3.7/site-packages/torch/include/TH -I/home/linfang/anaconda3/envs/hybridpose/lib/python3.7/site-packages/torch/include/THC -I/home/linfang/anaconda3/envs/hybridpose/include/python3.7m -c ./src/ransac_voting.cpp -o build/temp.linux-x86_64-3.7/./src/ransac_voting.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=ransac_voting -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from ./src/ransac_voting.cpp:1:0:
/home/linfang/anaconda3/envs/hybridpose/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/torch.h:11:4: warning: #warning "Including torch/torch.h for C++ extensions is deprecated. Please include torch/extension.h" [-Wcpp]
 #  warning "Including torch/torch.h for C++ extensions is deprecated. Please include torch/extension.h"
    ^~~~~~~
/usr/bin/nvcc -I/home/linfang/anaconda3/envs/hybridpose/lib/python3.7/site-packages/torch/include -I/home/linfang/anaconda3/envs/hybridpose/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/linfang/anaconda3/envs/hybridpose/lib/python3.7/site-packages/torch/include/TH -I/home/linfang/anaconda3/envs/hybridpose/lib/python3.7/site-packages/torch/include/THC -I/home/linfang/anaconda3/envs/hybridpose/include/python3.7m -c ./src/ransac_voting_kernel.cu -o build/temp.linux-x86_64-3.7/./src/ransac_voting_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=ransac_voting -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
g++ -pthread -shared -B /home/linfang/anaconda3/envs/hybridpose/compiler_compat -L/home/linfang/anaconda3/envs/hybridpose/lib -Wl,-rpath=/home/linfang/anaconda3/envs/hybridpose/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/./src/ransac_voting.o build/temp.linux-x86_64-3.7/./src/ransac_voting_kernel.o -L/usr/lib -lcudart -o build/lib.linux-x86_64-3.7/ransac_voting.cpython-37m-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-3.7/ransac_voting.cpython-37m-x86_64-linux-gnu.so -> 

@chensong1995
Copy link
Owner

Hello Linfang,

This error is unexpected to me. After some online searches, I suspect it has something to do with your CUDA version. My workstation has CUDA 10.1, and I am also able to compile the code on our department server which runs CUDA 10.0.

@chensong1995 chensong1995 added the question Further information is requested label Mar 26, 2020
@Lynne-Zheng-Linfang
Copy link
Author

Hello Linfang,

This error is unexpected to me. After some online searches, I suspect it has something to do with your CUDA version. My workstation has CUDA 10.1, and I am also able to compile the code on our department server which runs CUDA 10.0.

Hi, my CUDA version is 10.0. It is the problem with my virtual environment setting. I already solved it. Thank you!

@chensong1995
Copy link
Owner

I'm glad to hear it! It would be helpful if you can post your steps to resolve the problem here. Other people are going to be benefited from that.

@WHHHHY
Copy link

WHHHHY commented Sep 4, 2023

林芳你好,
这个错误出乎我的意料。网上查了一下,怀疑和你的CUDA版本有关系。我的工作站有 CUDA 10.1,我也可以在运行 CUDA 10.0 的部门服务器上编译代码。

你好,我的CUDA版本是10.0。这是我的虚拟环境设置的问题。我已经解决了。谢谢你!
Hello,

Hello Linfang,
This error is unexpected to me. After some online searches, I suspect it has something to do with your CUDA version. My workstation has CUDA 10.1, and I am also able to compile the code on our department server which runs CUDA 10.0.

Hi, my CUDA version is 10.0. It is the problem with my virtual environment setting. I already solved it. Thank you!

Hello,Linfang,
I encountered the same error as you,but,it seems like didn't work when I changed the version of CUDA,could you tell me how to fix this error,thank you !

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

No branches or pull requests

3 participants