Open dhuznn opened 5 years ago
cd <AFM_root>/lib
make
cd ..
conda develop <AFM_root>
conda develop <AFM_root>/lib
The conda will add paths into your virtual environment to solve this issue.
Please read the INSTALL.md carefully for this issue.
Hi, I also met the same problem.
And when I run make under
Hi, I also met the same problem.
And when I run make under
/lib, my output has this error: "error: command 'g++' failed with exit status 1" Does it mean make is not successful and cause the subsequent problem?
Yes. Did you check your compilers (including g++ and CUDA)?
Hi, I also met the same problem. And when I run make under
/lib, my output has this error: "error: command 'g++' failed with exit status 1" Does it mean make is not successful and cause the subsequent problem? Yes. Did you check your compilers (including g++ and CUDA)?
I'm using gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04):
Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
The CUDA driver version is 10.0. The deviceQuery result is PASS. And the pytorch is installed with cudatoolkit=10.0
Could you share all of the output after running the make command?
Could you share all of the output after running the make command? Here is output for make:
cd afm_op; python setup.py build_ext --inplace; rm -rf build; cd ../../
/usr/local/lib/python3.6/distutils/extension.py:131: UserWarning: Unknown Extension options: 'defined_macros'
warnings.warn(msg)
running build_ext
building 'CUDA' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/cuda
gcc -pthread -B /usr/local/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/usr/local/lib/python3.6/site-packages/torch/lib/include -I/usr/local/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/usr/local/lib/python3.6/site-packages/torch/lib/include/TH -I/usr/local/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/usr/local/include/python3.6m -c ./vision.cpp -o build/temp.linux-x86_64-3.6/./vision.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -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++
gcc -pthread -B /usr/local/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/usr/local/lib/python3.6/site-packages/torch/lib/include -I/usr/local/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/usr/local/lib/python3.6/site-packages/torch/lib/include/TH -I/usr/local/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/usr/local/include/python3.6m -c ./vision (1).cpp -o build/temp.linux-x86_64-3.6/./vision (1).o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -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++
/usr/local/cuda/bin/nvcc -I. -I/usr/local/lib/python3.6/site-packages/torch/lib/include -I/usr/local/lib/python3.6/site-packages/torch/lib/include/torch/csrc/api/include -I/usr/local/lib/python3.6/site-packages/torch/lib/include/TH -I/usr/local/lib/python3.6/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/usr/local/include/python3.6m -c ./cuda/afm.cu -o build/temp.linux-x86_64-3.6/./cuda/afm.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
creating build/lib.linux-x86_64-3.6
g++ -pthread -shared -B /usr/local/compiler_compat -L/usr/local/lib -Wl,-rpath=/usr/local/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/./vision.o build/temp.linux-x86_64-3.6/./vision (1).o build/temp.linux-x86_64-3.6/./cuda/afm.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/CUDA.cpython-36m-x86_64-linux-gnu.so
build/temp.linux-x86_64-3.6/./vision (1).o: In function std::operator-(std::_Bit_iterator_base const&, std::_Bit_iterator_base const&)': /usr/local/lib/python3.6/site-packages/torch/lib/include/pybind11/pybind11.h:419: multiple definition of
afm(at::Tensor const&, at::Tensor const&, int, int)'
build/temp.linux-x86_64-3.6/./vision.o:/content/gdrive/My Drive/SteelMesh/line detection/afm_cvpr2019-master/lib/afm_op/./afm.h:9: first defined here
build/temp.linux-x86_64-3.6/./vision (1).o: In function pybind11::detail::instance::allocate_layout()': /usr/include/c++/7/bits/stl_bvector.h:925: multiple definition of
PyInit_CUDA'
build/temp.linux-x86_64-3.6/./vision.o:/content/gdrive/My Drive/SteelMesh/line detection/afm_cvpr2019-master/lib/afm_op/./vision.cpp:3: first defined here
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1
cd squeeze/; python setup.py build_ext --inplace; rm -rf build; cd ../../
running build_ext
skipping 'squeeze.cpp' Cython extension (up-to-date)
multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'
The problem seems to be this error. Did you change the code?
multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'
The problem seems to be this error. Did you change the code?
Hi, I didn't change any.
multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'
The problem seems to be this error. Did you change the code?
Hi, I didn't change any.
I guess the problem is caused by gcc-7.3. I cannot compile with gcc-7.3 either but it works for gcc-5.4. I need more time to fix this problem.
multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'
The problem seems to be this error. Did you change the code?
Hi, I didn't change any.
I guess the problem is caused by gcc-7.3. I cannot compile with gcc-7.3 either but it works for gcc-5.4. I need more time to fix this problem.
I have tried to compile with gcc-5.5, it also gave the same error.
I have some problems, when i make ,the warning is , " skipping 'squeeze.cpp' Cython extension (up-to-date)"
make
cd afm_op; python setup.py build_ext --inplace; rm -rf build; cd ../../
/home/zyp/anaconda3/lib/python3.7/distutils/extension.py:131: UserWarning: Unknown Extension options: 'defined_macros'
warnings.warn(msg)
running build_ext
building 'CUDA' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/cuda
gcc -pthread -B /home/zyp/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zyp/anaconda3/include/python3.7m -c ./vision.cpp -o build/temp.linux-x86_64-3.7/./vision.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -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++
/usr/local/cuda/bin/nvcc -I. -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zyp/anaconda3/include/python3.7m -c ./cuda/afm.cu -o build/temp.linux-x86_64-3.7/./cuda/afm.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
creating build/lib.linux-x86_64-3.7
g++ -pthread -shared -B /home/zyp/anaconda3/compiler_compat -L/home/zyp/anaconda3/lib -Wl,-rpath=/home/zyp/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/./vision.o build/temp.linux-x86_64-3.7/./cuda/afm.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.7/CUDA.cpython-37m-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-3.7/CUDA.cpython-37m-x86_64-linux-gnu.so ->
cd squeeze/; python setup.py build_ext --inplace; rm -rf build; cd ../../
running build_ext
skipping 'squeeze.cpp' Cython extension (up-to-date)
I have some problems, when i make ,the warning is , " skipping 'squeeze.cpp' Cython extension (up-to-date)" make cd afm_op; python setup.py build_ext --inplace; rm -rf build; cd ../../ /home/zyp/anaconda3/lib/python3.7/distutils/extension.py:131: UserWarning: Unknown Extension options: 'defined_macros' warnings.warn(msg) running build_ext building 'CUDA' extension creating build creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/cuda gcc -pthread -B /home/zyp/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zyp/anaconda3/include/python3.7m -c ./vision.cpp -o build/temp.linux-x86_64-3.7/./vision.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -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++ /usr/local/cuda/bin/nvcc -I. -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zyp/anaconda3/include/python3.7m -c ./cuda/afm.cu -o build/temp.linux-x86_64-3.7/./cuda/afm.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 creating build/lib.linux-x86_64-3.7 g++ -pthread -shared -B /home/zyp/anaconda3/compiler_compat -L/home/zyp/anaconda3/lib -Wl,-rpath=/home/zyp/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/./vision.o build/temp.linux-x86_64-3.7/./cuda/afm.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.7/CUDA.cpython-37m-x86_64-linux-gnu.so copying build/lib.linux-x86_64-3.7/CUDA.cpython-37m-x86_64-linux-gnu.so -> cd squeeze/; python setup.py build_ext --inplace; rm -rf build; cd ../../ running build_ext skipping 'squeeze.cpp' Cython extension (up-to-date)
Hi, you can ignore the warnings. Your output is correct and the libraries have been compiled successfully.
multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'
The problem seems to be this error. Did you change the code?
Hi, I didn't change any.
I guess the problem is caused by gcc-7.3. I cannot compile with gcc-7.3 either but it works for gcc-5.4. I need more time to fix this problem.
I have tried to compile with gcc-5.5, it also gave the same error.
It is weird. Did you try to compile the lib on other computers?
I have some problems, when i make ,the warning is , " skipping 'squeeze.cpp' Cython extension (up-to-date)" make cd afm_op; python setup.py build_ext --inplace; rm -rf build; cd ../../ /home/zyp/anaconda3/lib/python3.7/distutils/extension.py:131: UserWarning: Unknown Extension options: 'defined_macros' warnings.warn(msg) running build_ext building 'CUDA' extension creating build creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/cuda gcc -pthread -B /home/zyp/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zyp/anaconda3/include/python3.7m -c ./vision.cpp -o build/temp.linux-x86_64-3.7/./vision.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -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++ /usr/local/cuda/bin/nvcc -I. -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zyp/anaconda3/include/python3.7m -c ./cuda/afm.cu -o build/temp.linux-x86_64-3.7/./cuda/afm.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 creating build/lib.linux-x86_64-3.7 g++ -pthread -shared -B /home/zyp/anaconda3/compiler_compat -L/home/zyp/anaconda3/lib -Wl,-rpath=/home/zyp/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/./vision.o build/temp.linux-x86_64-3.7/./cuda/afm.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.7/CUDA.cpython-37m-x86_64-linux-gnu.so copying build/lib.linux-x86_64-3.7/CUDA.cpython-37m-x86_64-linux-gnu.so -> cd squeeze/; python setup.py build_ext --inplace; rm -rf build; cd ../../ running build_ext skipping 'squeeze.cpp' Cython extension (up-to-date)
Hi, you can ignore the warnings. Your output is correct and the libraries have been compiled successfully.
thank you
I have some problems, when i make ,the warning is , " skipping 'squeeze.cpp' Cython extension (up-to-date)" make cd afm_op; python setup.py build_ext --inplace; rm -rf build; cd ../../ /home/zyp/anaconda3/lib/python3.7/distutils/extension.py:131: UserWarning: Unknown Extension options: 'defined_macros' warnings.warn(msg) running build_ext building 'CUDA' extension creating build creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/cuda gcc -pthread -B /home/zyp/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zyp/anaconda3/include/python3.7m -c ./vision.cpp -o build/temp.linux-x86_64-3.7/./vision.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -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++ /usr/local/cuda/bin/nvcc -I. -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zyp/anaconda3/include/python3.7m -c ./cuda/afm.cu -o build/temp.linux-x86_64-3.7/./cuda/afm.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 creating build/lib.linux-x86_64-3.7 g++ -pthread -shared -B /home/zyp/anaconda3/compiler_compat -L/home/zyp/anaconda3/lib -Wl,-rpath=/home/zyp/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/./vision.o build/temp.linux-x86_64-3.7/./cuda/afm.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.7/CUDA.cpython-37m-x86_64-linux-gnu.so copying build/lib.linux-x86_64-3.7/CUDA.cpython-37m-x86_64-linux-gnu.so -> cd squeeze/; python setup.py build_ext --inplace; rm -rf build; cd ../../ running build_ext skipping 'squeeze.cpp' Cython extension (up-to-date)
Hi, may I ask, did you also use gcc-5.4 to compile?
multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'
The problem seems to be this error. Did you change the code?
Hi, I didn't change any.
I guess the problem is caused by gcc-7.3. I cannot compile with gcc-7.3 either but it works for gcc-5.4. I need more time to fix this problem.
I have tried to compile with gcc-5.5, it also gave the same error.
It is weird. Did you try to compile the lib on other computers?
No, I only tried in google colab. Could that be the source of the problem?
I have some problems, when i make ,the warning is , " skipping 'squeeze.cpp' Cython extension (up-to-date)" make cd afm_op; python setup.py build_ext --inplace; rm -rf build; cd ../../ /home/zyp/anaconda3/lib/python3.7/distutils/extension.py:131: UserWarning: Unknown Extension options: 'defined_macros' warnings.warn(msg) running build_ext building 'CUDA' extension creating build creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/cuda gcc -pthread -B /home/zyp/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zyp/anaconda3/include/python3.7m -c ./vision.cpp -o build/temp.linux-x86_64-3.7/./vision.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -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++ /usr/local/cuda/bin/nvcc -I. -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/torch/csrc/api/include -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/TH -I/home/zyp/anaconda3/lib/python3.7/site-packages/torch/lib/include/THC -I/usr/local/cuda/include -I/home/zyp/anaconda3/include/python3.7m -c ./cuda/afm.cu -o build/temp.linux-x86_64-3.7/./cuda/afm.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 creating build/lib.linux-x86_64-3.7 g++ -pthread -shared -B /home/zyp/anaconda3/compiler_compat -L/home/zyp/anaconda3/lib -Wl,-rpath=/home/zyp/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/./vision.o build/temp.linux-x86_64-3.7/./cuda/afm.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.7/CUDA.cpython-37m-x86_64-linux-gnu.so copying build/lib.linux-x86_64-3.7/CUDA.cpython-37m-x86_64-linux-gnu.so -> cd squeeze/; python setup.py build_ext --inplace; rm -rf build; cd ../../ running build_ext skipping 'squeeze.cpp' Cython extension (up-to-date)
Hi, may I ask, did you also use gcc-5.4 to compile?
是的, 5.4.0
multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'
The problem seems to be this error. Did you change the code?
Hi, I didn't change any.
I guess the problem is caused by gcc-7.3. I cannot compile with gcc-7.3 either but it works for gcc-5.4. I need more time to fix this problem.
I have tried to compile with gcc-5.5, it also gave the same error.
It is weird. Did you try to compile the lib on other computers?
can i use python3.7?
I have the same issue, and it didn't work as the INSTALL.md .Otherwise,if i change 'from .CUDA import afm' to 'from .cuda import afm', the problem changes to 'ImportError: cannot import name 'afm''. I don't how to deal with it .
multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'
The problem seems to be this error. Did you change the code?
Hi, I didn't change any.
I guess the problem is caused by gcc-7.3. I cannot compile with gcc-7.3 either but it works for gcc-5.4. I need more time to fix this problem.
I have tried to compile with gcc-5.5, it also gave the same error.
It is weird. Did you try to compile the lib on other computers?
After I changed to AWS GPU, the problem solved.
RuntimeError: CUDA out of memory. Tried to allocate 25.00 MiB (GPU 0; 3.94 GiB total capacity; 3.14 GiB already allocated; 21.56 MiB free; 634.00 KiB cached)
do you have this problem?how to deal with it?
I have the same issue, and it didn't work as the INSTALL.md .Otherwise,if i change 'from .CUDA import afm' to 'from .cuda import afm', the problem changes to 'ImportError: cannot import name 'afm''. I don't how to deal with it .
You cannot change 'from .CUDA import afm' to 'from .cuda import afm'. The afm_op.CUDA is a compiled library for attraction field map generating.
multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'
The problem seems to be this error. Did you change the code?
Hi, I didn't change any.
I guess the problem is caused by gcc-7.3. I cannot compile with gcc-7.3 either but it works for gcc-5.4. I need more time to fix this problem.
I have tried to compile with gcc-5.5, it also gave the same error.
It is weird. Did you try to compile the lib on other computers?
After I changed to AWS GPU, the problem solved.
So, the problem is caused by colab?
multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'
The problem seems to be this error. Did you change the code?
Hi, I didn't change any.
I guess the problem is caused by gcc-7.3. I cannot compile with gcc-7.3 either but it works for gcc-5.4. I need more time to fix this problem.
I have tried to compile with gcc-5.5, it also gave the same error.
It is weird. Did you try to compile the lib on other computers?
After I changed to AWS GPU, the problem solved.
So, the problem is caused by colab?
Looks like colab can't compile the files when files are located in the mapped google drive path.
multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'
The problem seems to be this error. Did you change the code?
Hi, I didn't change any.
I guess the problem is caused by gcc-7.3. I cannot compile with gcc-7.3 either but it works for gcc-5.4. I need more time to fix this problem.
I have tried to compile with gcc-5.5, it also gave the same error.
It is weird. Did you try to compile the lib on other computers?
After I changed to AWS GPU, the problem solved.
So, the problem is caused by colab?
Looks like colab can't compile the files when files are located in the mapped google drive path.
hey, could you explain more details for how to solve this problem? Really thanks.
I get the error when I make the lib.
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/huangsiyu/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c squeeze.cpp -o build/temp.linux-x86_64-3.6/squeeze.o -Wno-unused-function squeeze.cpp:4:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Could you give any help?
I get the error when I make the lib.
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/huangsiyu/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c squeeze.cpp -o build/temp.linux-x86_64-3.6/squeeze.o -Wno-unused-function squeeze.cpp:4:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I have solved above problem by install python3.6-dev. Make environment: python 3.6 GCC 5.4 cuda 10.0
I get the error when I make the lib.
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/huangsiyu/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c squeeze.cpp -o build/temp.linux-x86_64-3.6/squeeze.o -Wno-unused-function squeeze.cpp:4:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I have solved above problem by install python3.6-dev. Make environment: python 3.6 GCC 5.4 cuda 10.0
Sorry for replying you late. Did you use the conda environment?
I get the error when I make the lib.
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/huangsiyu/.local/lib/python3.6/site-packages/numpy/core/include -I/usr/include/python3.6m -c squeeze.cpp -o build/temp.linux-x86_64-3.6/squeeze.o -Wno-unused-function squeeze.cpp:4:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
I have solved above problem by install python3.6-dev. Make environment: python 3.6 GCC 5.4 cuda 10.0
Sorry for replying you late. Did you use the conda environment?
No, I didn't use conda environment, I just use pip3 install to set the environment. It looks well now. I'll download the dataset and try it next.
Really thanks for your work!
@cherubicXN Your code runs OK with above environment.
Dear, you compile the makefile in Ubuntu or in Windows? I try to complie your code in window10, I install Wingw32 to complie the makefile, and also appear the error above.
Hi, I also met the same problem. And when I run make under
/lib, my output has this error: "error: command 'g++' failed with exit status 1" Does it mean make is not successful and cause the subsequent problem? Yes. Did you check your compilers (including g++ and CUDA)?
Hi, thanks to your work, i want to test the value of Precision and recall, but the code have nothing about it .Do you have the corresponding code?
multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'
The problem seems to be this error. Did you change the code?
Hi, I didn't change any.
I guess the problem is caused by gcc-7.3. I cannot compile with gcc-7.3 either but it works for gcc-5.4. I need more time to fix this problem.
Hi, thanks to your work, i want to test the value of Precision and recall, but the code have nothing about it .Do you have the corresponding code?
Hey, I am getting the same issue here after executing INSTALL.md without errors (seemly like), the following are details for make
and develop
:
(afm) user:~/afm_cvpr2019-master$ cd lib
(afm) user:~/afm_cvpr2019-master/lib$ make
cd afm_op; python setup.py build_ext --inplace; rm -rf build; cd ../../
/home/anaconda3/envs/afm/lib/python3.6/distutils/extension.py:131: UserWarning: Unknown Extension options: 'defined_macros'
warnings.warn(msg)
running build_ext
building 'CUDA' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/cuda
gcc -pthread -B /home/anaconda3/envs/afm/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/home/anaconda3/envs/afm/lib/python3.6/site-packages/torch/include -I/home/anaconda3/envs/afm/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/anaconda3/envs/afm/lib/python3.6/site-packages/torch/include/TH -I/home/anaconda3/envs/afm/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/anaconda3/envs/afm/include/python3.6m -c ./vision.cpp -o build/temp.linux-x86_64-3.6/./vision.o -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -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++
/usr/local/cuda/bin/nvcc -I. -I/home/anaconda3/envs/afm/lib/python3.6/site-packages/torch/include -I/home/anaconda3/envs/afm/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/anaconda3/envs/afm/lib/python3.6/site-packages/torch/include/TH -I/home/anaconda3/envs/afm/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/anaconda3/envs/afm/include/python3.6m -c ./cuda/afm.cu -o build/temp.linux-x86_64-3.6/./cuda/afm.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=CUDA -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
creating build/lib.linux-x86_64-3.6
g++ -pthread -shared -B /home/anaconda3/envs/afm/compiler_compat -L/home/anaconda3/envs/afm/lib -Wl,-rpath=/home/anaconda3/envs/afm/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/./vision.o build/temp.linux-x86_64-3.6/./cuda/afm.o -L/usr/local/cuda/lib64 -lcudart -o build/lib.linux-x86_64-3.6/CUDA.cpython-36m-x86_64-linux-gnu.so
copying build/lib.linux-x86_64-3.6/CUDA.cpython-36m-x86_64-linux-gnu.so ->
cd squeeze/; python setup.py build_ext --inplace; rm -rf build; cd ../../
running build_ext
skipping 'squeeze.cpp' Cython extension (up-to-date)
building 'squeeze' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -B /home/anaconda3/envs/afm/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/anaconda3/envs/afm/lib/python3.6/site-packages/numpy/core/include -I/home/anaconda3/envs/afm/include/python3.6m -c kernel.cpp -o build/temp.linux-x86_64-3.6/kernel.o -Wno-unused-function
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
kernel.cpp: In function ‘void region_grow(int, int, float, float&, std::vector<Point>&, std::vector<Point>&, std::vector<float>&, PoLsMap&, float)’:
kernel.cpp:132:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int id = 0; id < map(x,y).size(); ++id) {
~~~^~~~~~~~~~~~~~~~~
kernel.cpp:154:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < reg_int.size(); ++i)
~~^~~~~~~~~~~~~~~~
kernel.cpp:164:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int k = 0; k < map(xx,yy).size(); ++k) {
~~^~~~~~~~~~~~~~~~~~~
kernel.cpp: In function ‘bool region2rect(const std::vector<Point>&, const std::vector<float>&, float, float, float, Rectangle&)’:
kernel.cpp:199:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0; i<reg_int.size(); ++i)
~^~~~~~~~~~~~~~~
kernel.cpp:218:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0; i<reg_int.size(); ++i)
~^~~~~~~~~~~~~~~
kernel.cpp: In function ‘void refine(std::vector<Point>&, Rectangle&, std::vector<float>&, PoLsMap&)’:
kernel.cpp:277:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < reg_int.size(); ++i)
~~^~~~~~~~~~~~~~~~
kernel.cpp:291:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < reg_rot.size(); ++i)
~~^~~~~~~~~~~~~~~~
kernel.cpp:312:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < local_ind.size();++i)
~~^~~~~~~~~~~~~~~~~~
kernel.cpp:317:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int n = 0; n < map(x,y).size();++n)
~~^~~~~~~~~~~~~~~~~
kernel.cpp:267:11: warning: unused variable ‘x1’ [-Wunused-variable]
float x1 = rect.l_min*dx - rect.w_min*dy;
^~
kernel.cpp:268:11: warning: unused variable ‘y1’ [-Wunused-variable]
float y1 = rect.l_min*dy + rect.w_min*dx;
^~
kernel.cpp:269:11: warning: unused variable ‘x2’ [-Wunused-variable]
float x2 = rect.l_max*dx - rect.w_min*dy;
^~
kernel.cpp:270:11: warning: unused variable ‘y2’ [-Wunused-variable]
float y2 = rect.l_max*dy + rect.w_min*dx;
^~
kernel.cpp:271:11: warning: unused variable ‘x3’ [-Wunused-variable]
float x3 = rect.l_max*dx - rect.w_max*dy;
^~
kernel.cpp:272:11: warning: unused variable ‘y3’ [-Wunused-variable]
float y3 = rect.l_max*dy + rect.w_max*dx;
^~
kernel.cpp:273:11: warning: unused variable ‘x4’ [-Wunused-variable]
float x4 = rect.l_min*dx - rect.w_max*dy;
^~
kernel.cpp:274:11: warning: unused variable ‘y4’ [-Wunused-variable]
float y4 = rect.l_min*dy + rect.w_max*dx;
^~
kernel.cpp: In function ‘void _region_grow(int, int, const float*, const float*, const float*, int, float*, int*)’:
kernel.cpp:364:15: warning: unused variable ‘length’ [-Wunused-variable]
float length = sqrt((vec_rects[i].x1-vec_rects[i].x2)*(vec_rects[i].x1-vec_rects[i].x2) +
^~~~~~
gcc -pthread -B /home/anaconda3/envs/afm/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/anaconda3/envs/afm/lib/python3.6/site-packages/numpy/core/include -I/home/anaconda3/envs/afm/include/python3.6m -c squeeze.cpp -o build/temp.linux-x86_64-3.6/squeeze.o -Wno-unused-function
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from /home/anaconda3/envs/afm/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1832:0,
from /home/anaconda3/envs/afm/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
from /home/anaconda3/envs/afm/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from squeeze.cpp:581:
/home/anaconda3/envs/afm/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it with " \
^~~~~~~
g++ -pthread -shared -B /home/anaconda3/envs/afm/compiler_compat -L/home/anaconda3/envs/afm/lib -Wl,-rpath=/home/anaconda3/envs/afm/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.6/kernel.o build/temp.linux-x86_64-3.6/squeeze.o -o /home/afm_cvpr2019-master/lib/squeeze/squeeze.cpython-36m-x86_64-linux-gnu.so
(afm) user:~/afm_cvpr2019-master/lib$ conda develop . ./lib
added /home/.local/share/Trash/files/lib
completed operation for: /home/.local/share/Trash/files/lib
added /home/.local/share/Trash/files/lib/lib
completed operation for: /home/.local/share/Trash/files/lib/lib
I noticed this gets fixed easily if I'm building the library on a CUDA compatible PC
I have the same issue.