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

Under Ubuntu18.04。When I compile the number, there is an error calling the libwarp_perspective.so file。 #4

Open
yeyuxmf opened this issue Oct 23, 2019 · 4 comments

Comments

@yeyuxmf
Copy link

yeyuxmf commented Oct 23, 2019

OSError: /home/huang/vsopencv/extension-script/example_app/build/warp_perspective/libwarp_perspective.so: undefined symbol: _ZN3c1017RegisterOperators25checkSchemaAndRegisterOp_ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEONS0_7OptionsE

@yeyuxmf
Copy link
Author

yeyuxmf commented Oct 23, 2019

(pytorch) huang@huang-ubuntu:/vsopencv/extension-script/example_app/warp_perspective/build$ cmake -DCMAKE_PREFIX_PATH=/home/huang/libtorch1.2.0/libtorch ..
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found CUDA: /usr/local/cuda-10.0 (found version "10.0")
-- Caffe2: CUDA detected: 10.0
-- Caffe2: CUDA nvcc is: /usr/local/cuda-10.0/bin/nvcc
-- Caffe2: CUDA toolkit directory: /usr/local/cuda-10.0
-- Caffe2: Header version is: 10.0
-- Found CUDNN: /usr/local/cuda-10.0/include
-- Found cuDNN: v7.6.4 (include: /usr/local/cuda-10.0/include, library: /usr/local/cuda-10.0/lib64/libcudnn.so)
-- Autodetected CUDA architecture(s): 7.5
-- Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75
-- Found torch: /home/huang/libtorch1.2.0/libtorch/lib/libtorch.so
-- Pytorch status:
-- libraries: torch;torch_library;/home/huang/libtorch1.2.0/libtorch/lib/libc10.so;/usr/lib/x86_64-linux-gnu/libcuda.so;/usr/local/cuda-10.0/lib64/libnvrtc.so;/usr/local/cuda-10.0/lib64/libnvToolsExt.so;/usr/local/cuda-10.0/lib64/libcudart.so;/home/huang/libtorch1.2.0/libtorch/lib/libc10_cuda.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/huang/vsopencv/extension-script/example_app/warp_perspective/build
(pytorch) huang@huang-ubuntu:
/vsopencv/extension-script/example_app/warp_perspective/build$ make
Scanning dependencies of target warp_perspective
[ 50%] Building CXX object CMakeFiles/warp_perspective.dir/op.cpp.o
/home/huang/vsopencv/extension-script/example_app/warp_perspective/op.cpp:11:78: warning: ‘torch::jit::RegisterOperators::RegisterOperators(const string&, Implementation&&) [with Implementation = at::Tensor (*)(at::Tensor, at::Tensor); std::__cxx11::string = std::__cxx11::basic_string]’ is deprecated [-Wdeprecated-declarations]
torch::jit::RegisterOperators("my_ops::warp_perspective", &warp_perspective);
^
In file included from /home/huang/libtorch1.2.0/libtorch/include/torch/script.h:5:0,
from /home/huang/vsopencv/extension-script/example_app/warp_perspective/op.cpp:1:
/home/huang/libtorch1.2.0/libtorch/include/torch/csrc/jit/custom_operator.h:28:3: note: declared here
RegisterOperators(const std::string& name, Implementation&& implementation) {
^~~~~~~~~~~~~~~~~
[100%] Linking CXX shared library libwarp_perspective.so
[100%] Built target warp_perspective
(pytorch) huang@huang-ubuntu:~/vsopencv/extension-script/example_app/warp_perspective/build$ cmake -DCMAKE_PREFIX_PATH=/home/huang/libtorch1.2.0/libtorch ..

@zetyquickly
Copy link

Why don't you use a provided docker?

@yeyuxmf
Copy link
Author

yeyuxmf commented Oct 28, 2019

@zetyquickly The anaconda tool I use. But it's not about using containers. Containers are just convenient to provide a clean environment.

@leerumor
Copy link

leerumor commented Dec 7, 2019

@zetyquickly The anaconda tool I use. But it's not about using containers. Containers are just convenient to provide a clean environment.

I got the same error with docker, and several other issues. What version of pytorch do you use?

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

No branches or pull requests

3 participants