ZhangGongjie / Meta-DETR

[T-PAMI 2022] Meta-DETR for Few-Shot Object Detection: Official PyTorch Implementation
MIT License
388 stars 84 forks source link

error: command '/usr/bin/g++' failed with exit code 1 #41

Open HefengRAY opened 2 years ago

HefengRAY commented 2 years ago

some mistakes when compiling deformable attention with "sh ./make.sh"

g++ -pthread -B /home/ub/anaconda3/envs/metadetr/compiler_compat -Wl,--sysroot=/ -pthread -shared -B /home/ub/anaconda3/envs/metadetr/compiler_compat -L/home/ub/anaconda3/envs/metadetr/lib -Wl,-rpath=/home/ub/anaconda3/envs/metadetr/lib -Wl,--no-as-needed -Wl,--sysroot=/ /media/ub/eb78aac6-ede5-4037-8e5c-179e82f06841/pycharm_project/Meta-DETR-main/models/ops/build/temp.linux-x86_64-cpython-37/media/ub/eb78aac6-ede5-4037-8e5c-179e82f06841/pycharm_project/Meta-DETR-main/models/ops/src/cpu/ms_deform_attn_cpu.o /media/ub/eb78aac6-ede5-4037-8e5c-179e82f06841/pycharm_project/Meta-DETR-main/models/ops/build/temp.linux-x86_64-cpython-37/media/ub/eb78aac6-ede5-4037-8e5c-179e82f06841/pycharm_project/Meta-DETR-main/models/ops/src/cuda/ms_deform_attn_cuda.o /media/ub/eb78aac6-ede5-4037-8e5c-179e82f06841/pycharm_project/Meta-DETR-main/models/ops/build/temp.linux-x86_64-cpython-37/media/ub/eb78aac6-ede5-4037-8e5c-179e82f06841/pycharm_project/Meta-DETR-main/models/ops/src/vision.o -L/home/ub/anaconda3/envs/metadetr/lib/python3.7/site-packages/torch/lib -Lusr/local/cuda-11.1/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda_cu -ltorch_cuda_cpp -o build/lib.linux-x86_64-cpython-37/MultiScaleDeformableAttention.cpython-37m-x86_64-linux-gnu.so g++: error: /media/ub/eb78aac6-ede5-4037-8e5c-179e82f06841/pycharm_project/Meta-DETR-main/models/ops/build/temp.linux-x86_64-cpython-37/media/ub/eb78aac6-ede5-4037-8e5c-179e82f06841/pycharm_project/Meta-DETR-main/models/ops/src/cpu/ms_deform_attn_cpu.o: 没有那个文件或目录 g++: error: /media/ub/eb78aac6-ede5-4037-8e5c-179e82f06841/pycharm_project/Meta-DETR-main/models/ops/build/temp.linux-x86_64-cpython-37/media/ub/eb78aac6-ede5-4037-8e5c-179e82f06841/pycharm_project/Meta-DETR-main/models/ops/src/cuda/ms_deform_attn_cuda.o: 没有那个文件或目录 g++: error: /media/ub/eb78aac6-ede5-4037-8e5c-179e82f06841/pycharm_project/Meta-DETR-main/models/ops/build/temp.linux-x86_64-cpython-37/media/ub/eb78aac6-ede5-4037-8e5c-179e82f06841/pycharm_project/Meta-DETR-main/models/ops/src/vision.o: 没有那个文件或目录 error: command '/usr/bin/g++' failed with exit code 1

does anyone know how to deal with it?

ZhangGongjie commented 2 years ago

I suspect this is a GCC/G++ version issue.

May I know your gcc/g++ version?

HefengRAY commented 2 years ago

I suspect this is a GCC/G++ version issue.

May I know your gcc/g++ version?

i use 'gcc -v' to check gcc/g++ vision. vision is 9.4.0

Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:hsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.1' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --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 --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --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=/build/gcc-9-Av3uEd/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --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 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)

ZhangGongjie commented 2 years ago

It seems your gcc version is up-to-date. But I still recommend to use 7.5.0 to try again if you can.

Besides, since the error is due to the compilation of deformable attention, you may wish to check the page below. Hope it could help.

https://github.com/fundamentalvision/Deformable-DETR/issues/10