训练LaneATT遇到CUDA_HOME环境变量问题

我系统装了很久了,不记得之前CUDA是咋装了,然后训练神经网络一直也没啥问题,今天想学习LaneATT,车道线识别的项目,需要先安装nms,遇到如下问题:

(base) luke@luke-NH5x-7xRCx-RDx:~/Download/study/LaneATT/lib/nms$ python setup.py 
Traceback (most recent call last):
  File "setup.py", line 7, in 
    ext_modules=[CUDAExtension('nms.details', ['src/nms.cpp', 'src/nms_kernel.cu'])],
  File "/home/luke/miniconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 912, in CUDAExtension
    library_dirs += library_paths(cuda=True)
  File "/home/luke/miniconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1020, in library_paths
    if (not os.path.exists(_join_cuda_home(lib_dir)) and
  File "/home/luke/miniconda3/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 2035, in _join_cuda_home
    raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.
(base) luke@luke-NH5x-7xRCx-RDx:~/Download/study/LaneATT/lib/nms$ 

网上搜素怎么解决CUDA_HOME环境变量的问题,尚未搜到结果,然后有一个网页提示运行nvcc命令,但发现我电脑上没有该命令,提示需要安装 nvidia-cuda-toolkit

sudo apt install nvidia-cuda-toolkit

安装之后,依然没有CUDA_HOME环境变量,但此时执行 python setup.py install,直接安装成功了

纯属偏方

你可能感兴趣的:(计算机视觉,深度学习,pytorch,神经网络)