-
Notifications
You must be signed in to change notification settings - Fork 74.7k
Error importing tensorflow on windows 10 ( Tensorflow 0.12.0 RC0, python3.5 ) #5949
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
Comments
I'm sorry that it didn't work out of the box. Can you answer a couple of questions for me?
|
I'd would like to add that I have both version of python 2.7, 3.5 installed. I hope that's not the issue. |
It sounds like it has installed correctly, but one of the dependencies is missing. According to
Can you check that all of these files are on your system? It's possible that our development and test environment gets one of these from the build tools, and they aren't available as standard. |
We've just been able to reproduce the same error, and it was caused by a missing MSVCP140.dll. (Thanks @wolffg!) Installing the Microsoft Visual C++ 2015 Redistributable Update 3 (x64 version) should fix it. Can you please try that and let us know if it works? |
@mrry , worked like a charm. Thank you very much for the effort. |
@mrry 👍 Thanks very much! |
Thanks~~ |
@mrry , thank you. |
Thanks alot |
Thanks bro |
@mrry Sorry to bring this up again, I have the same issue as poster. I have been debugging this for several days but no luck. Any advice will be greatly appreciated! I did lack all of the api-ms-win-crt-*.dll files and python35.dll specifically(I am running in a virtual env of python3.5 in anaconda). I downloaded all the dll files online and add it back to C:\Windows\SysWOW64 but the problem still persists. I am using Python 3.5.3 |Continuum Analytics, Inc.| (default, Feb 22 2017, 21:28:42) [MSC v.1900 64 bit (AMD64)] on win32. My Cuda version is 8.0 and the driver is in v6.0, I have added the cuDNN files to my PATH, which is C:\Users\rando\cudnn-8.0-windows10-x64-v6.0\cuda My gpu is gtx-1080 and below is the error message:
During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems for some common reasons and solutions. Include the entire stack trace |
@Carmezim Plz help, any advice will be greatly appreciated! Thanks a lot! |
Same issue here, TensorFlow works with CPU but not with GPU (Nvidia) on Windows 10 |
You need to use cuDNN v.5.1, not version 6.0. Everything works for me after i have replaced v6.0 with v 5.1 |
@Randolph-zeng you shouldn't use cuDNN 6.0, according to TensorFlow requirements only 5.1 is supported on Windows. |
@Carmezim @YuriWerewolf Hi thanks for the answer, but I still can't get it to work. C:\Users\rando>path |
@Randolph-zeng I cannot really tell only by looking at your |
@Carmezim Okay, I will open a new issue. Thanks for the help! Have a great night! |
I'm having a similar problem. I tried rolling back to C++ Redist. 2015 (from 2017) and still not working. `Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems for some common reasons and solutions. Include the entire stack trace |
I'm not sure if someone will look in here cause it's "closed". Anyway, i've the same issue. I installed TensorFlow-GPU: I checked the import tensorflow as tf in my Jupiter Notebook and it worked. Thx for you help guys |
For users who find this issue when searching for the error message, I've created a script for diagnosing common TensorFlow on Windows installation issues. Please download the script from https://gist.github.com/mrry/ee5dbcfdd045fa48a27d56664411d41c and run |
@mrry Thanks for your script! Worked for me. |
@mrry thank you your script is very helpful, why don't you submit a pull request to add this script to the tensorflow library itself, so that it can be used as an install step? |
@alphashuro I'm glad it helped! Eventually we'll want to integrate some of the heuristics in the script into the import process, but I wanted to get something out there ASAP to help people who were struggling with these problems :). (One slight issue with integrating it in the repository is that we'd like it to be usable for people who haven't managed to install the library correctly....) |
@YuriWerewolf @Carmezim Thank you, I installed 6.0 and wondered why it didn't work, uninstalling 6.0 and installing 5.1 worked for me. Thanks for the help, stay awesome 👍 |
@YuriWerewolf @Carmezim Thank you, I installed 6.0 and wondered why it didn't work, uninstalling 6.0 and installing 5.1 worked for me. |
This is maybe a very stupid mistake but might help someone... I downloaded just CUDA 8 patch from the site and was wondering, why the error. Apparently, the patch does not care if you have CUDA 8 already installed, it just copied the dll and creates the intermediary directories, even looks like Cuda is installed in installed applications. |
Okay. Solved it. Same issue as TensorFlow 1.3 or later requires cuDNN 6. ('cudnn64_6.dll') |
@mrry best script ever! Thanks. I spent hours debugging, reinstalling, etc. You have save my day. Thanks a lot. |
I wanted to bring up an anomaly that occurred with pip that was causing the No module named '_pywrap_tensorflow_internal' error to occur. The version of python I was running was Python 3.6.3, pip was version 9.0.1. and it was running on Windows 10.
The installation command was
The solution was quite simple, I added a forced version number to match the most current version's name, which ran seamlessly and resolved the import error described above.
|
I have seen this error occuring in Tensorflow 1.4.0 as well because either cuDNN or CUDA toolkit DLLs being of wrong version or found in Anaconda folder instead of NVidia's folder. I've written a blog post on how to debug this error: http://shitalshah.com/p/debugging-tensorflow-dll-importerror/ Related issue: #14946 |
@mrry I wasted ample time before coming to this page. I was trying cpu installation of TF. It got resolved after installing visual c++. Thanks much for help. |
i tried the selfcheck.py and the report is as follows: ERROR: Failed to import the TensorFlow module.
|
I am stuck since hours but the issue is still not resolved. During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems for some common reasons and solutions. Include the entire stack trace **1. I have placed msvcp140.dll in system32(64-bit file) and SysWOW64(32-bit file) as advised in https://www.youtube.com/watch?v=61vwFxnnh5c
WARNING! This script is no longer maintained!Since TensorFlow 1.4, the self-check has been integrated with TensorFlow itself,
Please Help !!!!!! |
I have similar problem. I have a previous version of python 2.7 so I downloaded 3.5.4 Next I installed tensorflow using pip3 install --upgrade tensorflow The message: Directory of C:\Users\Walt\AppData\Local\Programs\Python\Python35\Lib\site-packages\tensorflow\python File Not Found |
After looking into this problem over few days I came across information that any tensorflow version that is >1.5 will not work with window. So my problem is solved. I downgraded to to 1.5. It's working. If you think this will help you then uninstall any previous version of TF and install the 1.5 version using this command: |
this was very helpful @Walt3r1 ,to the point and quicker. |
@Walt3r1 where did you find this information? To me it looks like any version on windows should work: https://www.tensorflow.org/install/source_windows |
Could not even run the basic example after installing Tensorflow 1.10.0 with pip install command. Thanks to the suggestion here -- Installing the Microsoft Visual C++ 2015 Redistributable Update 3 (x64 version) -- problem was fixed and able to work with Tensorflow with Spark now. |
i run the above command it show error "The system cannot find path specified |
Was excited to try out 0.12.0 RC0 for windows
Followed Tensorflow 0.12.0 RC0 Installation guide for Windows, on Windows 10.
Ran into following error.
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\hp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python_init_.py", line 54, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\hp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 21, in
_pywrap_tensorflow = swig_import_helper()
File "C:\Users\hp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
return importlib.import_module('pywrap_tensorflow')
File "C:\Users\hp\AppData\Local\Programs\Python\Python35\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 "<pyshell#0>", line 1, in
import tensorflow
File "C:\Users\hp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import *
File "C:\Users\hp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python_init_.py", line 60, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\hp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\hp\AppData\Local\Programs\Python\Python35\lib\importlib_init_.py", line 126, in import_module
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 906, 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 "C:\Users\hp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python_init_.py", line 54, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\hp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 21, in
_pywrap_tensorflow = swig_import_helper()
File "C:\Users\hp\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
return importlib.import_module('pywrap_tensorflow')
File "C:\Users\hp\AppData\Local\Programs\Python\Python35\lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow'
Error importing tensorflow. Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.
The text was updated successfully, but these errors were encountered: