theano出现以下错误:
错误(theano.sandbox.cuda):在$ PATH上找不到nvcc编译器。校验 您的nvcc安装,然后重试。
我已经尝试了先前问题给出的所有解决方案。运行nvcc -V
返回以下信息:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85
然后which nvcc
返回以下内容:
/usr/local/cuda-9.1/bin//nvcc
我还确认了/usr/local/cuda-9.1/bin
中有一个nvcc文件。
我运行了以下命令以确保可以找到nvcc:
export PATH=/usr/local/cuda-9.1/bin/:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-9.1/lib64:$LD_LIBRARY_PATH
exec bash
我已经确认nvcc位置肯定在$ PATH中,因为运行echo $PATH
返回以下内容:
/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/usr/local/cuda-9.1/bin/:/usr/local/cuda-9.1/bin/:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/usr/local/cuda/bin/:/home/paperspace/src/torch/install/bin:/home/paperspace/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-9-oracle/bin:/usr/lib/jvm/java-9-oracle/db/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin
此外,如果我打开python控制台并运行import os; print(os.environ["PATH"])
,则会得到以下内容(相同的内容):
/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/usr/local/cuda-9.1/bin/:/usr/local/cuda-9.1/bin/:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/usr/local/cuda/bin/:/home/paperspace/src/torch/install/bin:/home/paperspace/bin:/home/paperspace/anaconda3/bin:/home/paperspace/src/torch/install/bin:/home/paperspace/src/torch/install/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-9-oracle/bin:/usr/lib/jvm/java-9-oracle/db/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/cuda/bin
我在/ home / paperspace中的.theanorc文件如下:
[global]
device = cuda
floatX = float32
[cuda]
root = /usr/local/cuda-9.1