Closed
Description
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! :)
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
daxlab commentedon Feb 20, 2017
@SiddGururani Please try changing your directory to a directory other than the one where you installed tf.
Carmezim commentedon 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 commentedon Feb 20, 2017
@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 commentedon Feb 20, 2017
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 withpip install tensorflow-gpu
and see if it gives some result.You have one Python distribution installed right?
SiddGururani commentedon Feb 20, 2017
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 commentedon Feb 21, 2017
Are you getting OpKernel error? There are more recent nightlies (89) if you want to try as well.
SiddGururani commentedon Feb 21, 2017
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 commentedon 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:
And at least the Anaconda and the Windows system folders are in my
%PATH%
Carmezim commentedon 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 commentedon Feb 21, 2017
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 commentedon Feb 21, 2017
@mrry: windows build issue
mrry commentedon 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 commentedon Feb 21, 2017
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 commentedon Feb 21, 2017
Thanks for help resolving the previous issue. When I start a new session now though, it gives me these warnings:
Should I create a new issue for this?
40 remaining items
guitarmind commentedon 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 commentedon Aug 21, 2017
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 commentedon Aug 24, 2017
I spent forever on this issue only to find this open issue. Someone really needs to update the Windows guide
gunan commentedon Aug 24, 2017
@av8ramit Can we modify the webpage to point to cudnn 6?
GPhilo commentedon 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 commentedon Aug 25, 2017
We are in the process of updating the website right now. Thank you for your patience and sorry for any inconvenience.
2bethere commentedon Sep 11, 2017
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 commentedon 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 commentedon 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 commentedon Sep 17, 2017
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 commentedon Sep 22, 2017
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.
Coderx7 commentedon 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 commentedon Sep 22, 2017
@gunan would be a good idea to lock this thread?
gunan commentedon Sep 22, 2017
Locking due to this becoming a catchall for unrelated windows issues.
Most of the questions here are better suited for Stackoverflow.