Skip to content

ImportError: No module named '_pywrap_tensorflow' (MSVCP140.dll is present) #7705

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SiddGururani opened this issue Feb 20, 2017 · 61 comments
Closed
Assignees

Comments

@SiddGururani
Copy link

SiddGururani commented Feb 20, 2017

I installed the nightly build windows 64bit release of tensorflow from http://ci.tensorflow.org/view/Nightly/job/nightly-win/85/DEVICE=gpu,OS=windows/
using pip install in the Anaconda distribution of Python 3.5 (v4.1.1.0)

When I try to import tensorflow, I get the following error:

  File "C:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\Anaconda3\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 906, in create_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 66, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 21, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "C:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
    return importlib.import_module('_pywrap_tensorflow')
  File "C:\Anaconda3\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "C:\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 72, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\Anaconda3\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 906, in create_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 66, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 21, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "C:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
    return importlib.import_module('_pywrap_tensorflow')
  File "C:\Anaconda3\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow'

Failed to load the native TensorFlow runtime. 

I checked the msvcp140.dll and it seems to be present in multiple locations of my %PATH% (in the anaconda folder, in system32, sysWOW64 and some other locations).

I also have environment variables setup for the CUDA path.

The issue filed here: #7529 is essentially the same as mine but the user resolved it by shifting development to a VPS running Ubuntu. It still doesn't solve the problem though.

Any help would be appreciated! :)

@daxlab
Copy link
Contributor

daxlab commented Feb 20, 2017

@SiddGururani Please try changing your directory to a directory other than the one where you installed tf.

@Carmezim
Copy link
Contributor

Carmezim commented Feb 20, 2017

Today is a corporate Google holiday so it might take a little to get a googler response.
So just confirming, you have the Visual C++ Redistributable 2015 x64 installed, right?
Did the suggestion above generate any result for you?

@SiddGururani
Copy link
Author

@daxlab I tried that. Didn't help. I'm assuming you're talking about changing the working directory from where I run python and subsequently import tensorflow.

@Carmezim Yes, I checked MSVCP140.dll before trying to import tensorflow and after it failed, I did a fresh install of the VC redist package. Nothing changed.

@Carmezim
Copy link
Contributor

If you want to try uninstalling TensorFlow and installing with conda install in case you need to get it running for now. The package is not officially supported though, or try installing the PYPI package with pip install tensorflow-gpu and see if it gives some result.
You have one Python distribution installed right?

@SiddGururani
Copy link
Author

So when I use the PYPI package, it works. But gives the issues listed on #7621
The solution there was to install the nightly build. Maybe, for now I'll revert to the PYPI package.

Yes, I have one Python distribution.

@Carmezim
Copy link
Contributor

Are you getting OpKernel error? There are more recent nightlies (89) if you want to try as well.

@SiddGururani
Copy link
Author

Yes, I get the OpKernel errors with the PYPI package.

I'll try out using the latest nightly and see if it works. Shall keep you posted!

@SiddGururani
Copy link
Author

SiddGururani commented Feb 21, 2017

The most recent nightly build also gave the same error.

Just to make sure I'm right in saying that the MSVCP140.dll is in the path, here is the output of:

C:\>dir msvcp140.dll /b/s
C:\Anaconda3\msvcp140.dll
C:\Anaconda3\envs\tensorflow\msvcp140.dll
C:\Anaconda3\envs\tensorflow\Library\bin\msvcp140.dll
C:\Anaconda3\Library\bin\msvcp140.dll
C:\Anaconda3\pkgs\vs2015_runtime-14.0.25123-0\msvcp140.dll
C:\Anaconda3\pkgs\vs2015_runtime-14.0.25123-0\Library\bin\msvcp140.dll
C:\ProgramFiles\CommonFiles\microsoftshared\ClickToRun\msvcp140.dll
C:\ProgramFiles(x86)\Cisco\CiscoAnyConnectSecureMobilityClient\msvcp140.dll
C:\ProgramFiles(x86)\CommonFiles\MicrosoftShared\PhoneTools\14.0\Debugger\target\armv4i\MSVCP140.dll
C:\ProgramFiles(x86)\CommonFiles\MicrosoftShared\PhoneTools\14.0\Debugger\target\x86\MSVCP140.dll
C:\ProgramFiles(x86)\CommonFiles\MicrosoftShared\PhoneTools\14.0\DiagnosticsHub\target\armv4i\msvcp140.dll
C:\ProgramFiles(x86)\CommonFiles\MicrosoftShared\PhoneTools\14.0\DiagnosticsHub\target\armv4i\Collector\msvcp140.dll
C:\ProgramFiles(x86)\CommonFiles\MicrosoftShared\PhoneTools\14.0\DiagnosticsHub\target\x86\msvcp140.dll
C:\ProgramFiles(x86)\CommonFiles\MicrosoftShared\PhoneTools\14.0\DiagnosticsHub\target\x86\Collector\msvcp140.dll
C:\ProgramFiles(x86)\MicrosoftOffice\root\Flattener\msvcp140.dll
C:\ProgramFiles(x86)\MicrosoftOffice\root\vfs\System\msvcp140.dll
C:\ProgramFiles(x86)\MicrosoftOffice\root\vfs\SystemX86\msvcp140.dll
C:\Windows\Panther\MigrationShims\MigShim1\System32\msvcp140.dll
C:\Windows\Panther\MigrationShims\MigShim1\SysWOW64\msvcp140.dll
C:\Windows\System32\msvcp140.dll
C:\Windows\SysWOW64\msvcp140.dll

And at least the Anaconda and the Windows system folders are in my %PATH%

@Carmezim
Copy link
Contributor

Carmezim commented Feb 21, 2017

This issue was common with Python.org distribution and not Anaconda at least AFAIK. I will comment @mrry and @gunan here if you are sure your CUDA and cuDNN are also properly set as they will know better what can be happening.

@SiddGururani
Copy link
Author

I believe my CUDA and cuDNN are setup properly since the PYPI tensorflow-gpu package is able to find the CUDA dlls, but then it gives me the OpKernel errors.

@poxvoculi
Copy link
Contributor

@mrry: windows build issue

@mrry
Copy link
Contributor

mrry commented Feb 21, 2017

@SiddGururani Can you check if the CUDA and cuDNN DLLs are in directories named in your %PATH%? It looks like commit 191658d changed the way the CUDA-related DLLs were loaded after the 1.0 release branch was cut, so it's possible (although I'm not exactly sure why) that the library resolution would be different in the two versions.

@SiddGururani
Copy link
Author

Woah! So it looks like cuDNN wasn't setup properly. I put the dll, lib and .h file in CUDA's respective folders.
And it works.

@SiddGururani
Copy link
Author

Thanks for help resolving the previous issue. When I start a new session now though, it gives me these warnings:

2017-02-21 15:24:55.373328: W c:\tf_jenkins\home\workspace\nightly-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.
2017-02-21 15:24:55.373452: W c:\tf_jenkins\home\workspace\nightly-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations.
2017-02-21 15:24:55.373552: W c:\tf_jenkins\home\workspace\nightly-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
2017-02-21 15:24:55.373626: W c:\tf_jenkins\home\workspace\nightly-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-02-21 15:24:55.373695: W c:\tf_jenkins\home\workspace\nightly-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-02-21 15:24:55.373764: W c:\tf_jenkins\home\workspace\nightly-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-02-21 15:24:55.373833: W c:\tf_jenkins\home\workspace\nightly-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-02-21 15:24:55.373901: W c:\tf_jenkins\home\workspace\nightly-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. 

Should I create a new issue for this?

@gunan
Copy link
Contributor

gunan commented Feb 21, 2017

Those are simply warnings about performance.
They just say if you build from source, TF can be faster on your machine.

@gunan gunan closed this as completed Feb 21, 2017
@mrry
Copy link
Contributor

mrry commented Feb 21, 2017

@SiddGururani Thanks for digging into the problem with cuDNN paths! Let us know if we can improve the installation instructions to avoid this.

@SiddGururani
Copy link
Author

I think it would be helpful if you specifically instruct users to move the cuDNN files (the dll, lib and the header) from the cuDNN extracted folder into:
a.) A single folder containing all of these files and then add that folder to the %PATH% env variable.
b.) move the dll into CUDA's bin folder, the lib to CUDA's lib folder and the header to CUDA's include folder.
Thanks for helping me through the whole process! It's funny that the cuDNN path was an issue after I was so confident that wasn't the case!

@ybsave
Copy link

ybsave commented Apr 11, 2017

I have similar problem. After installation of MS VC++ 2015 Redistributable Update 3 x64, the problem still exists. I have tried the above method. However, it still does not work.
Can anyone help? Thank you.

My environment:
Windows 7 64 bit
Python 3.5.3
Tensorflow GPU 1.10rc1
Cuda 8.0
Cudnn 6.0

---------------Update--------------------
It's CuDNN 6's problem, which does NOT work on my environment! When I switch to Cudnn5.1, everything works fine! Thanks to @ZacDiggum who found the problem at 9066

Here are the error message when I "import tensorflow":

Traceback (most recent call last):
File "D:\Programs\Python35\lib\site-packages\tensorflow\python\pywrap_tensorfl
ow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "D:\Programs\Python35\lib\importlib_init_.py", line 126, in import_mod
ule
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 914, in create_module
File "", line 222, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Programs\Python35\lib\site-packages\tensorflow\python\pywrap_tensorfl
ow.py", line 41, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\Programs\Python35\lib\site-packages\tensorflow\python\pywrap_tensorfl
ow_internal.py", line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\Programs\Python35\lib\site-packages\tensorflow\python\pywrap_tensorfl
ow_internal.py", line 20, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')
File "D:\Programs\Python35\lib\importlib_init.py", line 126, in import_mod
ule
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "D:\Programs\Python35\lib\site-packages\tensorflow_init_.py", line 24,
in
from tensorflow.python import *
File "D:\Programs\Python35\lib\site-packages\tensorflow\python_init_.py", l
ine 51, in
from tensorflow.python import pywrap_tensorflow
File "D:\Programs\Python35\lib\site-packages\tensorflow\python\pywrap_tensorfl
ow.py", line 52, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "D:\Programs\Python35\lib\site-packages\tensorflow\python\pywrap_tensorfl
ow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "D:\Programs\Python35\lib\importlib_init_.py", line 126, in import_mod
ule
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 914, in create_module
File "", line 222, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Programs\Python35\lib\site-packages\tensorflow\python\pywrap_tensorfl
ow.py", line 41, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\Programs\Python35\lib\site-packages\tensorflow\python\pywrap_tensorfl
ow_internal.py", line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\Programs\Python35\lib\site-packages\tensorflow\python\pywrap_tensorfl
ow_internal.py", line 20, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')
File "D:\Programs\Python35\lib\importlib_init.py", line 126, in import_mod
ule
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_probl
ems

for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.

@Carmezim
Copy link
Contributor

@ybsave cuDNN 8.0? I suggest you review your CUDA related DLLs making sure they're properly set in your %PATH% and cuDNN libs are properly installed.

@ybsave
Copy link

ybsave commented Apr 11, 2017

@Carmezim Sorry for my typo. It was cuDNN 6.0. I have found the problem due to the cuDNN 6.0; when I switch to 5.1, everything works fine.

@Carmezim
Copy link
Contributor

@ybsave Glad to hear you figured it out.

@drophit
Copy link

drophit commented Apr 23, 2017

The problem was the cuDNN Library for me - for whatever reason cudnn-8.0-windows10-x64-v6.0 was NOT working - I used cudnn-8.0-windows10-x64-v5.1 - ALL GOOD!

My setup working with Win10 64 and the Nvidia GTX780M:

  • Be sure you have the lib MSVCP140.DLL by checking your system/path - if not get it here
  • Run the windows installer for python 3.5.3-amd64 from here - DO NOT try newer versions as they probably won't work
  • Get the cuDNN v5.1 for CUDA 8.0 from here - put it under your users folder or in another known location (you will need this in your path)
  • Get CUDA 8.0 x86_64 from here
  • Set PATH vars as expected to point at the cuDNN libs and python (the python path should be added during the python install)

If you run Windows 32 be sure to get the 32 bit versions of the files mentioned above.

@vburca
Copy link

vburca commented Apr 23, 2017

I had the same issue, was able to solve it by using cuDNN 5.1 instead of 6.0. Is there a reason why 6.0 is not working? Does it have something to do with Windows? Just curious

@grimsleydl
Copy link

I was having this issue and installing cuDNN 5.1 fixed it for me as well.

@ZacheryGuan
Copy link

ZacheryGuan commented Apr 23, 2017

I just solved the problem with reinstalling python35 using customize installation by checking all the boxes and then next, checking all the boxes again (especially the last two - Download debugging symbols and binaries).

After that, using pip3 install tensorflow to reinstall tensorflow again, it works, though I've installed tensorflow before.

Still, it has many warnings when I test the program 😞

@Wenthalpy
Copy link

@jcomfort4 I have solved the problem by the method discribed above. I guess the program just need a file like 'cudnn64_5.dll' and named 'cudnn64_5.dll'. If you changed the name of 'cudnn64_6.dll' (which in cuDNN6.0) to 'cudnn64_5.dll' , it still worked.(But I haven' t tested it for further use.)
I advise you to check that you've put the file in right folder, because I noticed that you type them in wrong order.
cudnn64_5.dll -----------------CUDA\v8.0\bin
cudnn.h------------------------CUDA\v8.0\include
cudnn.lib-----------------------CUDA\v8.0\lib\x64

@shaozu
Copy link

shaozu commented Jul 21, 2017

@drophit I have the same issue and this solution works for me. Thanks a lot.

@Dinpo
Copy link

Dinpo commented Aug 17, 2017

I'm getting the same issue, and followed all of the above advice, no luck.

It's super hard to debug, if its one or the other file that is missing. Couldn't Tensorflow be better at telling you what file it can't include?

I'm trying this combination Windows 10 + Python 3.5.2 + cuDNN 5.1 + CUDA 8.0 + Tensorflow 1.3.

I've tried all cuDNN versions from 7 to 5.1 (All the DLL's can exist in same dir, as they are named differently)
I made PATH point here. I even print os.getenv('PATH') in the start of my script to check that it's there.
It's only the DLL's that need to go in the path, right? (not the .lib)

msvcp140.dll is located all over my system, including a lot which PATH points to.

@mrry
Copy link
Contributor

mrry commented Aug 17, 2017

@DinoP I believe the released version of TensorFlow 1.3 depends on cuDNN 6, so it's probably looking for cudnn64_6.dll.

@Dinpo
Copy link

Dinpo commented Aug 17, 2017

Thank for the answer.

As I wrote, I both have version 5.1, 6 and 7 installed in that dir. So should'nt be be that.

The "v8.0\bin" dir looks like this:
03/06/2017 19:08 47,600,128 cublas64_80.dll
07/11/2016 11:08 83,148,288 cudnn64_5.dll
12/04/2017 13:59 152,321,536 cudnn64_6.dll
25/07/2017 19:18 213,226,496 cudnn64_7.dll
03/06/2017 19:09 226,304 nvblas64_80.dll

@mrry Also back to my point about Tensorflow not letting me know what file it's expects in the error output, make is tooo much harder to debug.

@Dinpo
Copy link

Dinpo commented Aug 17, 2017

So, I thought I had a breakthrough... did "pip uninstall tensorflow tensorflow-gpu" and then "pip install tensorflow-gpu"

My suddenly script then didn't fail at the import of TF.... hurray... but only cpu devices were available (no gpu).

Makes sense that it did not fail then, but I'm not sure why it stopped showing my gpu.

Anyone knows how to force my script to use tensorflow-gpu or "re-enable" my gpu devices?

@Adrian-Steinert
Copy link

Adrian-Steinert commented Aug 17, 2017

Greetings,

i had the same issues described above:

Import errors as well as the case described 4 hours ago. What helped me in my case was in fact the cuDNN Version 6.

I am using python 3.6, CUDA 8, cuDNN 6 and tensorflow-gpu 1.3.0 on Windows 10 x64. For cuDNN I extracted the content of bin, include and lib to the respective folders in ...\CUDA\v8.0\

I hope this resolves the issue for some of you guys.

EDIT: What may help as well to check if tensorflow really uses GPU is this solution on stackoverflow.

@hsed
Copy link

hsed commented Aug 18, 2017

Been trying to install tensorflow since a few days now and guides hardly ever keep up with updates to newer components. Thanks @Adrian-Steinert, your combination of packages is the one that finally worked for me!

@guitarmind
Copy link

guitarmind commented Aug 19, 2017

@mrry @Adrian-Steinert
Thanks a lot for mentioning this!

I can confirm that at least for tensorflow version 1.3.0, we need to download cudnn-8.0-windows10-x64-v6.0 for cuDNN 6.0, because it is looking for cudnn64_6.dll, not cudnn64_5.dll anymore!

Wasted so much times due to this kind of hidden dll naming constraint, hope this can be helpful to other people who encountered loading dll failed issue.

@Dinpo
Copy link

Dinpo commented Aug 20, 2017

Ok, so i think i finally found the solution to my problem. I've followed every guide out there, so was just about to give up.

First of all, thanks @mrry creating this script: https://gist.github.com/mrry/ee5dbcfdd045fa48a27d56664411d41c
It made me aware of my problem. It told me that cudart64_80.dll was missing.

So when going to the Nvidia download page, you get presented with 2 downloads, Base installer and "Patch 2". Because Patch 2 was a larger file size than base I thought this version contained everything. Also "Patch 2" installs with no problems, even though Base installation is missing.

So it turned out that I missed the Base installation and didn't have CUDA properly installed, only the Patch.

Hope this helps the others.

@Dinpo
Copy link

Dinpo commented Aug 20, 2017

..... only to discover that GPU is twice as slow as CPU at the task I'm trying solve (GTX1080)

@Innixma
Copy link

Innixma commented Aug 21, 2017

@guitarmind I can also confirm that this worked for me! This is huge, I spent ages and ages trying to solve this while having cudnn 5.1 because every single guide said that cudnn 6 doesn't work, but in reality cudnn 6 is required for the current tensorflow-gpu 1.3.0

@guitarmind
Copy link

guitarmind commented Aug 21, 2017

@Innixma I did exactly the same....tried to reinstall python, CUDA, cuDNN, check environment variables so many times.

Totally misled by all public guides until I saw this issue page. Could anyone update the official installation guide of TensorFlow to mention about this for the updates after tensorflow-gpu 1.3.0?

@Cody2333
Copy link

I solve the exact problem by using Cudnn 6.0 instead of Cudnn 5.0 recently. (cudnn-8.0-windows10-x64-v6.0).

While the document metioned https://www.tensorflow.org/versions/r1.3/install/install_windows is still wrong about Cudnn's version

@jbencina
Copy link

I spent forever on this issue only to find this open issue. Someone really needs to update the Windows guide

@gunan
Copy link
Contributor

gunan commented Aug 24, 2017

@av8ramit Can we modify the webpage to point to cudnn 6?

@GPhilo
Copy link

GPhilo commented Aug 25, 2017

I happened to avoid the problem because I was lucky enough to read the 1.3.0 changelog where they mention that binaries are now build against cuDNN 6.0. Time to update the install guides (there's already people on StackOverflow scratching their heads)

@av8ramit
Copy link

We are in the process of updating the website right now. Thank you for your patience and sorry for any inconvenience.

@2bethere
Copy link

Oh god....I fixed it on my machine!

You guys are right! Tensorflow 1.3 requires cudnn64_6.dll not cudnn64_7.dll

You should use the 6.0 CUDNN version with TF 1.3

@into4321
Copy link

into4321 commented Sep 14, 2017

cudnn64_6.dll work for me ,a "pan" help for me , ^o^,tks
link for cuDNN 6.0: https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v6/prod/8.0_20170307/cudnn-8.0-windows10-x64-v6.0-zip size:104M

@Coderx7
Copy link

Coderx7 commented Sep 14, 2017

I had the same issue today in upgrading to 1.3.0. I had both cudnnv5.1 and cudnnv6.0, but in the PATH system variable, cudnnv5.1 was used. replaced it with cudnnv6 and all errors are gone!

@blistergeist
Copy link

I just wrestled with this for a couple hours (Windows 10, Anaconda 4.4.0 64 bit). I had been trying to install tensorflow-gpu using pip with no success. I followed all the guides I could find, tried using Python 3.5.3, installed cudnn 5.1 and 6.0, tried different combinations using conda environments, and still ran into the same error.

I found that installing via conda rather than pip worked the first time. Conda installed cudatoolkit, cudnn, libprotobuf, and protobuf and updated itself and vs2015_runtime.

Apparently conda is better at putting all this stuff in the right place than I am. Praise conda.

@sulaimanvesal
Copy link

To resolve the problem in windows 10, I did the following:
1. pip uninstall tensorflow-gpu

Open Anancoda prompt with administrative access and then run the following command.
conda install tensorflow-gpu

This will take care of everything paths, cuda, cudnn and dll files and will install everything in the particular place.


Package plan for installation in environment C:\Anaconda3:

The following NEW packages will be INSTALLED:

    cudatoolkit:    8.0-1
    cudnn:          6.0-0
    libprotobuf:    3.2.0-vc14_0       [vc14]
    protobuf:       3.2.0-py35_0
    tensorflow-gpu: 1.1.0-np112py35_0
    vc:             14-0

The following packages will be UPDATED:

    astropy:        1.3.3-np111py35_0  --> 2.0.2-py35h891525e_4
    bottleneck:     1.2.1-np111py35_0  --> 1.2.1-np112py35_0
    h5py:           2.7.0-np111py35_0  --> 2.7.0-np112py35_0
    matplotlib:     2.0.2-np111py35_0  --> 2.0.2-np112py35_0
    numba:          0.33.0-np111py35_0 --> 0.33.0-np112py35_0
    numexpr:        2.6.2-np111py35_0  --> 2.6.2-np112py35_0
    numpy:          1.11.3-py35_0      --> 1.12.1-py35_0
    pandas:         0.20.1-np111py35_0 --> 0.20.3-py35_0
    pytables:       3.2.2-np111py35_4  --> 3.2.2-np112py35_4
    pywavelets:     0.5.2-np111py35_0  --> 0.5.2-np112py35_0
    scikit-image:   0.13.0-np111py35_0 --> 0.13.0-np112py35_0
    scikit-learn:   0.18.1-np111py35_1 --> 0.19.0-np112py35_0
    scipy:          0.19.0-np111py35_0 --> 0.19.1-np112py35_0
    statsmodels:    0.8.0-np111py35_0  --> 0.8.0-np112py35_0
    vs2015_runtime: 14.00.23026.0-0    --> 14.0.25420-0
    werkzeug:       0.11.4-py35_0      --> 0.12.2-py35_0

Proceed ([y]/n)? y

cudatoolkit-8. 100% |###############################| Time: 0:00:03 103.92 MB/s
cudnn-6.0-0.ta 100% |###############################| Time: 0:00:01  61.40 MB/s
vs2015_runtime 100% |###############################| Time: 0:00:00  50.37 MB/s
vc-14-0.tar.bz 100% |###############################| Time: 0:00:00 117.44 kB/s
libprotobuf-3. 100% |###############################| Time: 0:00:00  59.48 MB/s
numpy-1.12.1-p 100% |###############################| Time: 0:00:00  54.71 MB/s
werkzeug-0.12. 100% |###############################| Time: 0:00:00  32.00 MB/s
bottleneck-1.2 100% |###############################| Time: 0:00:00   6.92 MB/s
h5py-2.7.0-np1 100% |###############################| Time: 0:00:00  39.03 MB/s
numba-0.33.0-n 100% |###############################| Time: 0:00:00  54.14 MB/s
numexpr-2.6.2- 100% |###############################| Time: 0:00:00  15.75 MB/s
protobuf-3.2.0 100% |###############################| Time: 0:00:00  31.49 MB/s
pywavelets-0.5 100% |###############################| Time: 0:00:00  52.60 MB/s
scipy-0.19.1-n 100% |###############################| Time: 0:00:00  61.34 MB/s
astropy-2.0.2- 100% |###############################| Time: 0:00:00  59.28 MB/s
pandas-0.20.3- 100% |###############################| Time: 0:00:00  52.79 MB/s
pytables-3.2.2 100% |###############################| Time: 0:00:00  42.35 MB/s
scikit-learn-0 100% |###############################| Time: 0:00:00  51.41 MB/s
tensorflow-gpu 100% |###############################| Time: 0:00:01  36.20 MB/s
matplotlib-2.0 100% |###############################| Time: 0:00:00  56.54 MB/s
statsmodels-0. 100% |###############################| Time: 0:00:00  56.49 MB/s
scikit-image-0 100% |###############################| Time: 0:00:00  49.93 MB/s

@Coderx7
Copy link

Coderx7 commented Sep 22, 2017

@sulaimanvesal it seems conda is not up to date for the windows platform, since it installs version 1.1 which belongs to almost 5 months ago while the current version is 1.3.0!

@Carmezim
Copy link
Contributor

@gunan would be a good idea to lock this thread?

@gunan
Copy link
Contributor

gunan commented Sep 22, 2017

Locking due to this becoming a catchall for unrelated windows issues.
Most of the questions here are better suited for Stackoverflow.

@tensorflow tensorflow locked and limited conversation to collaborators Sep 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests