Tensorflow install on Windows Error

2019-01-20 14:20发布

Tensorflow is now available on Windows:

 https://developers.googleblog.com/2016/11/tensorflow-0-12-adds-support-for-windows.html

I used pip install tensorflow.

I try running the intro code:

 https://www.tensorflow.org/versions/r0.12/get_started/index.html

I get this error:

C:\Python\Python35-32\python.exe "C:/tensorflow_tutorial.py"
Traceback (most recent call last):
  File "C:\Python\Python35-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper
return importlib.import_module(mname)
  File "C:\Python\Python35-32\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
   File "<frozen importlib._bootstrap>", line 986, in _gcd_import
   File "<frozen importlib._bootstrap>", line 969, in _find_and_load
   File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 666, in _load_unlocked
   File "<frozen importlib._bootstrap>", line 577, in module_from_spec
   File "<frozen importlib._bootstrap_external>", line 903, in create_module
   File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
 ImportError: DLL load failed: %1 is not a valid Win32 application.

This site had some suggestions on DLL's that were missing but anyones guess is good:

https://github.com/tensorflow/tensorflow/issues/5949

Update: I switched to x64 I get this error:

I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:119] Couldn't open CUDA library cublas64_80.dll
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_blas.cc:2294] Unable to load cuBLAS DSO.
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:119] Couldn't open CUDA library cudnn64_5.dll
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_dnn.cc:3459] Unable to load cuDNN DSO
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:119] Couldn't open CUDA library cufft64_80.dll
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_fft.cc:344] Unable to load cuFFT DSO.
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:119] Couldn't open CUDA library nvcuda.dll
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_diagnostics.cc:165] hostname: ����

Update2:

I installed the nvidia cuda files

 https://developer.nvidia.com/cuda-downloads

Im getting these errors:

I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library cublas64_80.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:119] Couldn't open CUDA library cudnn64_5.dll
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_dnn.cc:3459] Unable to load cuDNN DSO
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library cufft64_80.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:119] Couldn't open CUDA library nvcuda.dll
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_diagnostics.cc:165] hostname: �٩��

Update3:

I registered and downloaded the cudnn packge from NVIDIA

 https://developer.nvidia.com/cudnn

Moved the file location

C:\Desktop\cudnn-8.0-windows10-x64-v5.1.zip\cuda\bin\cudnn64_5.dll to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\cudnn64_5.dll

Still get this error:

 I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:119] Couldn't open CUDA library nvcuda.dll

Update 4:

Downloaded nvcuda.dll into C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin

This resolved my issue.

4条回答
我欲成王,谁敢阻挡
2楼-- · 2019-01-20 14:48

The problem is not with platform (amd64) but with GPU drivers. You need to either install packages which runs on CPU or use that GPU ones you already installed but install also CUDA drivers.

查看更多
男人必须洒脱
3楼-- · 2019-01-20 14:52

From the path of your Python interpreter (C:\Python\Python35-32), it appears that you are using the 32-bit version of Python 3.5. The official TensorFlow packages are only available for 64-bit architectures (x64/amd64), so you have two options:

  1. Install the 64-bit version of Python 3.5 (either from Python.org or Anaconda), or

  2. Compile the PIP package yourself for 32-bit Python 3.5. You may be able to do this using the experimental CMake build (see here for details), but this is not a supported or tested configuration.

(Note that I'm not sure how you installed the package on a 32-bit version of Python, because when I tried to do that I got an error message: "Not a supported wheel on this platform.")

查看更多
Lonely孤独者°
4楼-- · 2019-01-20 14:59

IF you are installing the GPU version please make sure you have following on your system:

  • CUDA® Toolkit 9.0. For details, see NVIDIA's documentation Ensure that you append the relevant Cuda pathnames to the %PATH% environment variable as described in the NVIDIA documentation.
  • The NVIDIA drivers associated with CUDA Toolkit 9.0.
  • cuDNN v7.0. For details, see NVIDIA's documentation. Note that cuDNN is typically installed in a different location from the other CUDA DLLs. Ensure that you add the directory where you installed the cuDNN DLL to your %PATH% environment variable.
  • GPU card with CUDA Compute Capability 3.0 or higher for building from source and 3.5 or higher for our binaries. See NVIDIA documentation for a list of supported GPU cards.
查看更多
啃猪蹄的小仙女
5楼-- · 2019-01-20 15:07

you can find cudnn64_5.dll file inside "cuda\bin"[this is cudnn-8.0-windows7-x64-v5.1_4 zip extraction folder].Then copy above file into "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin". This is work for Python 3.5 bit 64 version and Windows 7 bit 64 environment

查看更多
登录 后发表回答