Closed baiboat closed 2 years ago
Hello baiboat,
Thanks for your attention to our work.
You need to follow the compiling instruction in the README.md
to build the NS block first.
This error can also occur when the NS block is compiled incorrectly. It would be helpful to paste your compiling process.
Thank you for your reply, the compiling instruction do you mean "python setup.py build develop" operation, I have built this file as the README.md, I get following output:
running build running build_ext UserWarning:
!! WARNING !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch! Please use a compiler that is ABI-compatible with GCC 4.9 and above. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.
See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6 for instructions on how to install GCC 4.9 or higher. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! WARNING !!
warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler))
building 'self_cuda_backend' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/home
creating build/temp.linux-x86_64-3.6/home/zwc
creating build/temp.linux-x86_64-3.6/home/zwc/文档
creating build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main
creating build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib
creating build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module
creating build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module/PNS
creating build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/TH -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/zwc/anaconda3/envs/PNS+/include/python3.6m -c /home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/sa_ext.cpp -o build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/sa_ext.o -std=c++11 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=self_cuda_backend -D_GLIBCXX_USE_CXX11_ABI=0
cc1plus: 警告:command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [默认启用]
/home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/sa_ext.cpp:117:2: 警告:“/”出现在注释中 [-Wcomment]
/
^
/home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/sa_ext.cpp:123:2: 警告:“/”出现在注释中 [-Wcomment]
/
^
/usr/local/cuda/bin/nvcc -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/TH -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/zwc/anaconda3/envs/PNS+/include/python3.6m -c /home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/sa.cu -o build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/sa.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --compiler-options '-fPIC' -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=self_cuda_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/pybind11/detail/common.h(528): warning: invalid narrowing conversion from "nv_bool" to "unsigned long"
detected during:
instantiation of "pybind11::size_t pybind11::detail::constexpr_sum(T, Ts...) [with T=nv_bool, Ts=<>]"
/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/pybind11/pybind11.h(129): here
instantiation of "void pybind11::cpp_function::initialize(Func &&, Return (*)(Args...), const Extra &...) [with Func=lambda ->pybind11::str, Return=pybind11::str, Args=
/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/pybind11/detail/common.h(528): warning: invalid narrowing conversion from "__nv_bool" to "unsigned long"
detected during:
instantiation of "pybind11::size_t pybind11::detail::constexpr_sum(T, Ts...) [with T=__nv_bool, Ts=<>]"
/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/pybind11/pybind11.h(129): here
instantiation of "void pybind11::cpp_function::initialize(Func &&, Return (*)(Args...), const Extra &...) [with Func=lambda ->pybind11::str, Return=pybind11::str, Args=
/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/c10/util/ArrayRef.h:277:48: 警告:‘deprecated’属性指定被忽略 [-Wattributes]
using IntList C10_DEPRECATED_USING = ArrayRef
!! WARNING !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch! Please use a compiler that is ABI-compatible with GCC 4.9 and above. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.
See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6 for instructions on how to install GCC 4.9 or higher. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! WARNING !!
warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler)) copying build/lib.linux-x86_64-3.6/self_cuda_backend.cpython-36m-x86_64-linux-gnu.so -> Creating /home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/self-cuda.egg-link (link to .) Removing self-cuda 0.0.0 from easy-install.pth file Adding self-cuda 0.0.0 to easy-install.pth file
Installed /home/zwc/文档/VPS-main/lib/module/PNS Processing dependencies for self-cuda==0.0.0 Finished processing dependencies for self-cuda==0.0.0
I only get some warning here, so is this not compiling successfully, or is there any other requirement I missed?
Thank you for your reply, the compiling instruction do you mean "python setup.py build develop" operation, I have built this file as the README.md, I get following output:
running build running build_ext UserWarning:
!! WARNING !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch! Please use a compiler that is ABI-compatible with GCC 4.9 and above. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.
See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6 for instructions on how to install GCC 4.9 or higher. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! WARNING !!
warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler)) building 'self_cuda_backend' extension creating build creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/home creating build/temp.linux-x86_64-3.6/home/zwc creating build/temp.linux-x86_64-3.6/home/zwc/文档 creating build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main creating build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib creating build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module creating build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module/PNS creating build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/TH -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/zwc/anaconda3/envs/PNS+/include/python3.6m -c /home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/sa_ext.cpp -o build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/sa_ext.o -std=c++11 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=self_cuda_backend -D_GLIBCXX_USE_CXX11_ABI=0 cc1plus: 警告:command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [默认启用] /home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/saext.cpp:117:2: 警告:“/”出现在注释中 [-Wcomment] /_ ^ /home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/saext.cpp:123:2: 警告:“/”出现在注释中 [-Wcomment] /_ ^ /usr/local/cuda/bin/nvcc -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/TH -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/zwc/anaconda3/envs/PNS+/include/python3.6m -c /home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/sa.cu -o build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/sa.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --compiler-options '-fPIC' -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_70,code=compute_70 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=self_cuda_backend -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11 /home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/pybind11/detail/common.h(528): warning: invalid narrowing conversion from "nv_bool" to "unsigned long" detected during: instantiation of "pybind11::size_t pybind11::detail::constexpr_sum(T, Ts...) [with T=nv_bool, Ts=<>]" /home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/pybind11/pybind11.h(129): here instantiation of "void pybind11::cpp_function::initialize(Func &&, Return (*)(Args...), const Extra &...) [with Func=lambda ->pybind11::str, Return=pybind11::str, Args=pybind11::handle, Extra=pybind11::is_method]" /home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/pybind11/pybind11.h(68): here instantiation of "pybind11::cpp_function::cpp_function(Func &&, const Extra &...) [with Func=lambda ->pybind11::str, Extra=pybind11::is_method, =void]" /home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/pybind11/pybind11.h(1393): here
/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/pybind11/detail/common.h(528): warning: invalid narrowing conversion from "__nv_bool" to "unsigned long" detected during: instantiation of "pybind11::size_t pybind11::detail::constexpr_sum(T, Ts...) [with T=__nv_bool, Ts=<>]" /home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/pybind11/pybind11.h(129): here instantiation of "void pybind11::cpp_function::initialize(Func &&, Return (*)(Args...), const Extra &...) [with Func=lambda ->pybind11::str, Return=pybind11::str, Args=pybind11::handle, Extra=pybind11::is_method]" /home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/pybind11/pybind11.h(68): here instantiation of "pybind11::cpp_function::cpp_function(Func &&, const Extra &...) [with Func=lambda ->pybind11::str, Extra=pybind11::is_method, =void]" /home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/pybind11/pybind11.h(1393): here
/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/c10/util/ArrayRef.h:277:48: 警告:‘deprecated’属性指定被忽略 [-Wattributes] using IntList C10_DEPRECATED_USING = ArrayRef
; ^ gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/TH -I/home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/zwc/anaconda3/envs/PNS+/include/python3.6m -c /home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/reference.cpp -o build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/reference.o -std=c++11 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=self_cuda_backend -D_GLIBCXX_USE_CXX11_ABI=0 cc1plus: 警告:command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [默认启用] creating build/lib.linux-x86_64-3.6 g++ -pthread -shared -L/home/zwc/anaconda3/envs/PNS+/lib -Wl,-rpath=/home/zwc/anaconda3/envs/PNS+/lib,--no-as-needed build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/sa_ext.o build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/sa.o build/temp.linux-x86_64-3.6/home/zwc/文档/VPS-main/lib/module/PNS/PNS_Module/reference.o -L/usr/local/cuda/lib64 -L/home/zwc/anaconda3/envs/PNS+/lib -lcudart -lpython3.6m -o build/lib.linux-x86_64-3.6/self_cuda_backend.cpython-36m-x86_64-linux-gnu.so running develop running egg_info creating self_cuda.egg-info writing self_cuda.egg-info/PKG-INFO writing dependency_links to self_cuda.egg-info/dependency_links.txt writing top-level names to self_cuda.egg-info/top_level.txt writing manifest file 'self_cuda.egg-info/SOURCES.txt' reading manifest file 'self_cuda.egg-info/SOURCES.txt' writing manifest file 'self_cuda.egg-info/SOURCES.txt' running build_ext /home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/torch/utils/cpp_extension.py:191: UserWarning: !! WARNING !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch! Please use a compiler that is ABI-compatible with GCC 4.9 and above. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.
See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6 for instructions on how to install GCC 4.9 or higher. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! WARNING !!
warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler)) copying build/lib.linux-x86_64-3.6/self_cuda_backend.cpython-36m-x86_64-linux-gnu.so -> Creating /home/zwc/anaconda3/envs/PNS+/lib/python3.6/site-packages/self-cuda.egg-link (link to .) Removing self-cuda 0.0.0 from easy-install.pth file Adding self-cuda 0.0.0 to easy-install.pth file
Installed /home/zwc/文档/VPS-main/lib/module/PNS Processing dependencies for self-cuda==0.0.0 Finished processing dependencies for self-cuda==0.0.0
I only get some warning here, so is this not compiling successfully, or is there any other requirement I missed?
It seems that your GCC version is incompatible with PyTorch, causing the compilation to fail. The default version of GCC downloaded by Centos7 using DNF or YUM is lower. For your information, the version I used is 5.4.0. You can upgrade GCC following the instruction in the warning:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Your compiler (g++ 4.8.5) may be ABI-incompatible with PyTorch! Please use a compiler that is ABI-compatible with GCC 4.9 and above. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.
See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6 for instructions on how to install GCC 4.9 or higher. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Many thanks for you suggestion, after upgrade the gcc 4.8.5 to a new version of 8.3.1, I can train now. But I still find some unimportant problems you may want to fix when I deploy,
The problem1 and 2 can be fixed by just change the path in the config file, but the problem3 I just delete line 120 and line 121 in mytrain.py for run.
Thanks again!
Many thanks for you suggestion, after upgrade the gcc 4.8.5 to a new version of 8.3.1, I can train now. But I still find some unimportant problems you may want to fix when I deploy,
FileNotFoundError: [Errno 2] No such file or directory: 'utils/statistics.pth'
FileNotFoundError: [Errno 2] No such file or directory: './data/TrainDataset/Frame'
File "./scripts/my_train.py", line 120, in
logging.info('Train on {}'.format(config.video_dataset))
AttributeError: 'Namespace' object has no attribute 'video_dataset'
The problem1 and 2 can be fixed by just change the path in the config file, but the problem3 I just delete line 120 and line 121 in mytrain.py for run.
Thanks again!
Thanks for your advices! I will correct the code as soon as possible. Feel free to let us know if there's any problem.
hi,
First of all, thank you for your excellent work. when I try to train, I get the following error:
ImportError: self_cuda_backend.cpython-36m-x86_64-linux-gnu.so: undefined symbol _ZN6caffe26detail36_typeMetaDataInstance_preallocated_7E.
And this is reported when running the PNSPlusMoudle.py. My OS is centos7, Cuda version is 10.0, PyTorch version is 1.1, GPU is titan XP with 12GB memory.