afm_cvpr2019 icon indicating copy to clipboard operation
afm_cvpr2019 copied to clipboard

ModuleNotFoundError: No module named 'lib.afm_op.CUDA'

Open dhuznn opened this issue 5 years ago • 36 comments

dhuznn avatar Mar 22 '19 08:03 dhuznn

I have the same issue.

TangXiaoyu9 avatar Apr 01 '19 11:04 TangXiaoyu9

  1. Please ensure the libraries located in <AFM_root>/lib is compiled in the first. If not, please run
cd <AFM_root>/lib
make
cd ..
  1. 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.

cherubicXN avatar Apr 04 '19 03:04 cherubicXN

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?

ShidiDaisy avatar Apr 22 '19 16:04 ShidiDaisy

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)?

cherubicXN avatar Apr 23 '19 06:04 cherubicXN

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

ShidiDaisy avatar Apr 23 '19 08:04 ShidiDaisy

Could you share all of the output after running the make command?

cherubicXN avatar Apr 23 '19 08:04 cherubicXN

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)

ShidiDaisy avatar Apr 23 '19 08:04 ShidiDaisy

multiple definition of afm(at::Tensor const&, at::Tensor const&, int, int)'

The problem seems to be this error. Did you change the code?

cherubicXN avatar Apr 23 '19 08:04 cherubicXN

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.

ShidiDaisy avatar Apr 23 '19 08:04 ShidiDaisy

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.

cherubicXN avatar Apr 23 '19 09:04 cherubicXN

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.

ShidiDaisy avatar Apr 23 '19 11:04 ShidiDaisy

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)

zhiyunpengpeng avatar Apr 24 '19 02:04 zhiyunpengpeng

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.

cherubicXN avatar Apr 25 '19 07:04 cherubicXN

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?

cherubicXN avatar Apr 25 '19 07:04 cherubicXN

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

zhiyunpengpeng avatar Apr 26 '19 02:04 zhiyunpengpeng

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?

ShidiDaisy avatar Apr 27 '19 16:04 ShidiDaisy

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?

ShidiDaisy avatar Apr 27 '19 16:04 ShidiDaisy

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

zhiyunpengpeng avatar May 10 '19 03:05 zhiyunpengpeng

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?

zhiyunpengpeng avatar May 12 '19 09:05 zhiyunpengpeng

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 .

chengxius avatar May 14 '19 09:05 chengxius

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.

ShidiDaisy avatar May 15 '19 03:05 ShidiDaisy

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?

zhiyunpengpeng avatar May 16 '19 06:05 zhiyunpengpeng

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.

cherubicXN avatar May 16 '19 14:05 cherubicXN

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?

cherubicXN avatar May 16 '19 14:05 cherubicXN

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.

ShidiDaisy avatar May 22 '19 06:05 ShidiDaisy

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.

siyuada avatar Jul 31 '19 12:07 siyuada

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?

siyuada avatar Jul 31 '19 12:07 siyuada

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

siyuada avatar Aug 06 '19 02:08 siyuada

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?

cherubicXN avatar Aug 06 '19 03:08 cherubicXN

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!

siyuada avatar Aug 06 '19 04:08 siyuada