afm_cvpr2019
afm_cvpr2019 copied to clipboard
ModuleNotFoundError: No module named 'lib.afm_op.CUDA'
I have the same issue.
- Please ensure the libraries located in <AFM_root>/lib is compiled in the first. If not, please run
cd <AFM_root>/lib
make
cd ..
- Once the lib is compiled, please run the commands
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 <AFM_root>/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?
Hi, I also met the same problem.
And when I run make under <AFM_root>/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 <AFM_root>/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 -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 /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 -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.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 -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.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 -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.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 -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.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 -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.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!