我的配置:win7+Anaconda3-4.4.0+python3.6+cuda9.0+cudnn7.1
按照网上教程安装好之后import tensorflow出现两个错误:
(1)OSError: [WinError 126]找不到指定的模块;
(2)ImportError: Could not find 'cudart64_90.dll'. TensorFlowrequires that this DLL be installed in a directory that is named in your %PATH%environment variable. Download and install CUDA 9.0 from this URL: https://developer.nvidia.com/cuda-toolkit。
在网上搜有很多人遇到这样的问题,可能原因是:
(1)anaconda安装时没有勾选配置环境变量;
(2)tensorflow版本不匹配。
我是属于版本不匹配原因,pip install tensorflow_gpu安装的是最新版的1.8版本,将其卸载pip uninstall tensorflow_gpu,安装1.7版本:pip install tensorflow_gpu==1.7即可。