700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > PointTransformer编译pointops_cuda报错fatal error: THC/THC.h: No such file or directory

PointTransformer编译pointops_cuda报错fatal error: THC/THC.h: No such file or directory

时间:2023-12-11 11:45:23

相关推荐

PointTransformer编译pointops_cuda报错fatal error: THC/THC.h: No such file or directory

错误信息

Ubuntu 20.04CUDA 11.6PyTorch 1.13.0

尝试运行PointTransformer代码, 编译pointops_cuda的时候报错:

> py setup.py installrunning install/home/dl/.conda/envs/dl/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.warnings.warn(/home/dl/.conda/envs/dl/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.warnings.warn(running bdist_eggrunning egg_infocreating pointops.egg-infowriting pointops.egg-info/PKG-INFOwriting dependency_links to pointops.egg-info/dependency_links.txtwriting top-level names to pointops.egg-info/top_level.txtwriting manifest file 'pointops.egg-info/SOURCES.txt'/home/dl/.conda/envs/dl/lib/python3.8/site-packages/torch/utils/cpp_extension.py:476: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.warnings.warn(msg.format('we could not find ninja.'))reading manifest file 'pointops.egg-info/SOURCES.txt'writing manifest file 'pointops.egg-info/SOURCES.txt'installing library code to build/bdist.linux-x86_64/eggrunning install_librunning build_extbuilding 'pointops_cuda' extensioncreating buildcreating build/temp.linux-x86_64-cpython-38creating build/temp.linux-x86_64-cpython-38/srccreating build/temp.linux-x86_64-cpython-38/src/aggregationcreating build/temp.linux-x86_64-cpython-38/src/groupingcreating build/temp.linux-x86_64-cpython-38/src/interpolationcreating build/temp.linux-x86_64-cpython-38/src/knnquerycreating build/temp.linux-x86_64-cpython-38/src/samplingcreating build/temp.linux-x86_64-cpython-38/src/subtractiongcc -pthread -B /home/dl/.conda/envs/dl/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/dl/.conda/envs/dl/lib/python3.8/site-packages/torch/include -I/home/dl/.conda/envs/dl/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/.conda/envs/dl/lib/python3.8/site-packages/torch/include/TH -I/home/dl/.conda/envs/dl/lib/python3.8/site-packages/torch/include/THC -I/home/dl/.conda/envs/dl/include -I/home/dl/.conda/envs/dl/include/python3.8 -c src/aggregation/aggregation_cuda.cpp -o build/temp.linux-x86_64-cpython-38/src/aggregation/aggregation_cuda.o -g -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=pointops_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++src/aggregation/aggregation_cuda.cpp:2:10: fatal error: THC/THC.h: 没有那个文件或目录2 | #include <THC/THC.h>|^~~~~~~~~~~compilation terminated.error: command '/usr/bin/gcc' failed with exit code 1(dl) dl@kemove-desktop:~/point-transformer/lib/pointops$ py setup.py installrunning install/home/dl/.conda/envs/dl/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.warnings.warn(/home/dl/.conda/envs/dl/lib/python3.8/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.warnings.warn(running bdist_eggrunning egg_infowriting pointops.egg-info/PKG-INFOwriting dependency_links to pointops.egg-info/dependency_links.txtwriting top-level names to pointops.egg-info/top_level.txt/home/dl/.conda/envs/dl/lib/python3.8/site-packages/torch/utils/cpp_extension.py:476: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.warnings.warn(msg.format('we could not find ninja.'))reading manifest file 'pointops.egg-info/SOURCES.txt'writing manifest file 'pointops.egg-info/SOURCES.txt'installing library code to build/bdist.linux-x86_64/eggrunning install_librunning build_extbuilding 'pointops_cuda' extensiongcc -pthread -B /home/dl/.conda/envs/dl/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/dl/.conda/envs/dl/lib/python3.8/site-packages/torch/include -I/home/dl/.conda/envs/dl/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/dl/.conda/envs/dl/lib/python3.8/site-packages/torch/include/TH -I/home/dl/.conda/envs/dl/lib/python3.8/site-packages/torch/include/THC -I/home/dl/.conda/envs/dl/include -I/home/dl/.conda/envs/dl/include/python3.8 -c src/aggregation/aggregation_cuda.cpp -o build/temp.linux-x86_64-cpython-38/src/aggregation/aggregation_cuda.o -g -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1011\" -DTORCH_EXTENSION_NAME=pointops_cuda -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++src/aggregation/aggregation_cuda.cpp:2:10: fatal error: THC/THC.h: 没有那个文件或目录2 | #include <THC/THC.h>|^~~~~~~~~~~compilation terminated.error: command '/usr/bin/gcc' failed with exit code 1

原因

原因是pytorch 1.9之后的某个版本删除了THC.h, 参考 fatal error: THC/THC.h: No such file or directory - CSDN。

解决方法

先排除2个正确答案:

老老实实运行储存库提供的env_setup.sh新装一个pytorch=1.9.0的环境。

降级pytorch1.9.0

我使用的是下述方法:

Ctrl+Shift+F全局搜索并删除每一行#include <THC/THC.h>

然后再编译就能通过了

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。