简体   繁体   中英

Tensorflow-gpu 1.9 is not working on Pycharm

I can't import tensorflow in pycharm, it raises the following error:

ImportError: Could not find 'cudart64_90.dll'. TensorFlow requires 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

I checked this cudart file and its added in %PATH%

It is working on CLI and python shell perfectly.

I have

CUDA v9.0
cuDNN v7.0.5
tensorflow-gpu v1.9

echo %PATH%

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\libnvvp;
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\extras\CUPTI\libx64;

Directory of cudar64_90.dll:

07/27/2018  02:53 PM    <DIR>          .
07/27/2018  02:53 PM    <DIR>          ..
09/02/2017  03:45 PM           163,840 bin2c.exe
07/27/2018  02:28 PM    <DIR>          crt
05/16/2018  11:18 PM        55,161,856 cublas64_90.dll
09/02/2017  03:45 PM           347,136 cuda-memcheck.exe
09/02/2017  03:45 PM         3,930,112 cudafe++.exe
09/02/2017  03:45 PM         4,226,048 cudafe.exe
09/02/2017  03:46 PM           299,520 cudart32_90.dll
09/02/2017  03:46 PM           373,760 cudart64_90.dll
11/16/2017  07:51 PM       286,877,184 cudnn64_7.dll
09/02/2017  03:46 PM       131,197,952 cufft64_90.dll
09/02/2017  03:46 PM           199,680 cufftw64_90.dll
09/02/2017  03:46 PM         3,575,808 cuinj32_90.dll
09/02/2017  03:46 PM         4,495,360 cuinj64_90.dll
09/02/2017  03:45 PM         1,411,072 cuobjdump.exe
09/02/2017  03:46 PM        48,057,344 curand64_90.dll
09/02/2017  03:46 PM        75,222,016 cusolver64_90.dll
09/02/2017  03:46 PM        54,782,464 cusparse64_90.dll
09/02/2017  03:45 PM           246,784 fatbinary.exe
09/02/2017  03:46 PM         1,274,880 gpu-library-advisor.exe
09/02/2017  03:46 PM           205,824 nppc64_90.dll
09/02/2017  03:46 PM         9,744,384 nppial64_90.dll
09/02/2017  03:46 PM         3,953,664 nppicc64_90.dll
09/02/2017  03:46 PM         1,035,264 nppicom64_90.dll
09/02/2017  03:46 PM         7,291,392 nppidei64_90.dll
09/02/2017  03:46 PM        55,641,088 nppif64_90.dll
09/02/2017  03:46 PM        26,491,904 nppig64_90.dll
09/02/2017  03:46 PM         4,767,232 nppim64_90.dll
09/02/2017  03:46 PM        14,943,232 nppist64_90.dll
09/02/2017  03:46 PM           179,200 nppisu64_90.dll
09/02/2017  03:46 PM         2,629,120 nppitc64_90.dll
09/02/2017  03:46 PM         9,024,512 npps64_90.dll
05/16/2018  11:18 PM           241,664 nvblas64_90.dll
09/02/2017  03:45 PM           325,632 nvcc.exe
09/02/2017  03:45 PM               328 nvcc.profile
09/02/2017  03:45 PM        16,261,120 nvdisasm.exe
09/02/2017  03:46 PM        15,747,584 nvgraph64_90.dll
09/02/2017  03:45 PM         7,202,304 nvlink.exe
09/02/2017  03:45 PM         4,005,376 nvprof.exe
09/02/2017  03:45 PM           181,248 nvprune.exe
09/02/2017  03:46 PM         3,182,592 nvrtc-builtins64_90.dll
09/02/2017  03:46 PM        17,302,016 nvrtc64_90.dll
09/02/2017  03:46 PM                53 nvvp.bat
05/16/2018  11:16 PM         7,082,496 ptxas.exe

Looking into the tensorflow-1.9 release branch , it looks like they used CUDA 9.0 and CUDNN 7.1.4

So I think you should download CUDNN 7.1.4. Hopefully, the issue will be fixed.

You can check everything works by running this handy script written by one of the authors of the tensorflow . It will show you exactly what is not working right.

EDIT: For CUDA 10.0 it's CUDNN version 7.6.2.24-1 (see here ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM