Skip to content

tensorflow-gpu rc0 import tensorflow error windows 10 64bit nvidia 1080 TI #9066

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
udnaan opened this issue Apr 8, 2017 · 23 comments
Closed

Comments

@udnaan
Copy link

udnaan commented Apr 8, 2017

NOTE: Issues that are not bugs or feature requests will be closed. Please ask usage questions on StackOverflow.

You must complete this information or else your issue will be closed

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow)?:
    No
  • TensorFlow installed from (source or binary)?:
    binary
  • TensorFlow version:
    pip rc0 or rc1
    nightly
  • Bazel version (if compiling from source):
    NA
  • CUDA/cuDNN version:
    8.0
  • GPU Model and Memory:
    Nvidia 1080 ti
  • Exact command to reproduce:
    install tensorflow from nightly or using tensorflow==1.1.0rc0 or 1.1.0rc1 through pip (I'm using conda to create the environment)
    start python
    import tensorflow

Describe the problem clearly

I followed the suggestion of installing nightly due to the warnings regarding unknown OP
see #8500
The install is successful however the import tensorflow fails with the following log

Source Code / Logs

Python 3.5.3 |Continuum Analytics, Inc.| (default, Feb 22 2017, 21:28:42) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "c:\tools\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "c:\tools\Anaconda3\envs\tensorflow\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 914, 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:\tools\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "c:\tools\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "c:\tools\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
    return importlib.import_module('_pywrap_tensorflow_internal')
  File "c:\tools\Anaconda3\envs\tensorflow\lib\importlib\__init__.py", line 126, in import_module
    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 "<stdin>", line 1, in <module>
  File "c:\tools\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "c:\tools\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\__init__.py", line 51, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "c:\tools\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 52, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "c:\tools\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
    return importlib.import_module(mname)
  File "c:\tools\Anaconda3\envs\tensorflow\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 914, 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:\tools\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "c:\tools\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "c:\tools\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
    return importlib.import_module('_pywrap_tensorflow_internal')
  File "c:\tools\Anaconda3\envs\tensorflow\lib\importlib\__init__.py", line 126, in import_module
    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_problems

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

LeifRoss commented Apr 8, 2017

Having the same issue, tried pretty much all of the relevant builds on jenkins, and its either the OPS error, or this one.

If you just need a version of tensorflow to work with asap, you can get the cpu version running by installing version 1.1.0rc1 and suppressing the level 2 warnings.

pip3 uninstall tensorflow-gpu
pip3 install --upgrade tensorflow==1.1.0rc1

import tensorflow as tf
import os

os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

And then install the gpu version when someone replies with a proper fix.

@ZacDiggum
Copy link

Same thing over here.
System specs are identical to @udnaan's except the GPU is a GTX 1080. This solution doesn't help either. Any ideas?

@AdityaPrasadMishra
Copy link

I am facing the same issue with 840M GPU.

@Carmezim
Copy link
Contributor

Carmezim commented Apr 9, 2017

Hi @udnaan, sorry you're facing issues.
Could you please check if your CUDA and cuDNN environment variables are properly set and their DLLs directories are found in your %PATH%

@udnaan
Copy link
Author

udnaan commented Apr 9, 2017

Already done.

PATH=C:\Users\nan\Downloads\ConEmu\ConEmu\Scripts;C:\Users\nan\Downloads\ConEmu;C:\Users\nan\Downloads\ConEmu\ConEmu;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\libnvvp;C:\Python36\Scripts\;C:\Python36\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\nodejs\;C:\Program Files (x86)\Yarn\bin;c:\tools\Anaconda3\Scripts;c:\program files\Cmake\bin;C:\Program Files (x86)\vim\vim80;c:\Program files\git\bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin;c:\tools\Anaconda3\Scripts

The dll files are inside the C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin folder

The issue seems to be with the following versions: rc0 - onwards and nightlies.
The 1.0 version works but with the unknown OP warning (the ones that I've noted in the original report)

@Carmezim
Copy link
Contributor

Carmezim commented Apr 9, 2017

@udnaan After 1.0 there were changes on how TF load CUDA related DLLs, see this.

Regarding OpKernels logs, they can be ignored. Just checking, your cuDNN is 5.1, right? Which nightly build did you install?

@udnaan
Copy link
Author

udnaan commented Apr 9, 2017 via email

@Carmezim
Copy link
Contributor

Carmezim commented Apr 9, 2017

@udnaan a way for you to check if is not Cuda related is to uninstall TF and install the CPU version and if you still receive the same error is TF or Anaconda wise .

@udnaan
Copy link
Author

udnaan commented Apr 9, 2017

@Carmezim thanks for the hint. I'll try that as well. Will take a couple of hours since I'm afk atm

@udnaan
Copy link
Author

udnaan commented Apr 10, 2017

@Carmezim You were right. I was missing the cudnn library all together. Thanks a lot for your help.

@udnaan udnaan closed this as completed Apr 10, 2017
@Carmezim
Copy link
Contributor

@udnaan you're welcome.

@Carmezim
Copy link
Contributor

Carmezim commented Apr 10, 2017

@LeifRoss @AdityaPrasadMishra @ZacDiggum Did you make progress with the solution?
Let me know if you're still facing issues.

@Carmezim
Copy link
Contributor

Carmezim commented Apr 10, 2017

HI @mrry, do you think even affecting a very small subset of users is worth a reference on common problems about CUDA related DLLs installation when receiving this error?

@LeifRoss
Copy link

@Carmezim Indeed, the issue has been resolved, thank you for the assistance!

@mrry
Copy link
Contributor

mrry commented Apr 10, 2017

@Carmezim That might make sense... it's a little unfortunate that the new way of loading modules doesn't produce an actionable error message (whereas it used to say "Couldn't open CUDA library cudnn64_5.dll" and we had a link to this Stack Overflow answer). Now the error message for a misconfigured CUDA and for (e.g.) a missing Visual C++ redistributable are the same.

I'll follow up with some people who understand the rationale for how we load modules in the latest version and see if I can get some suggestions.

(In the meantime, it looks like the link that's printed on error doesn't include a link to the Windows-specific common problems, so I'll fix that first.)

@Carmezim
Copy link
Contributor

@mrry now I fully understood what is happening. That error message was useful indeed.

The Redistributable is really python.org dist. specific? Because if it is, do you think for now that's one way to differentiate the solutions?

Awesome!

@ZacDiggum
Copy link

Got it! Previously I had CuDNN 6 installed. After switching to 5.1 everything works fine...

@ybsave
Copy link

ybsave commented Apr 11, 2017

@ZacDiggum Thank you so much! I have tried all solutions I can find but nothing except yours works! CuDNN 6 does NOT work on my environment!

@Carmezim
Copy link
Contributor

@ybsave @ZacDiggum It is defined on installation guide under only cuDNN 5.1 is supported on Windows Requirements to run TensorFlow with GPU support:

cuDNN v5.1. 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.

Glad you sorted it out.

@ybsave
Copy link

ybsave commented Apr 11, 2017

@Carmezim Thank you for pointing it out. I previously thought that versions no older than the ones on the webpage were OK. Then later I finally noticed that Python 3.6 and cuDNN 6 are both not compatible with Tensorflow GPU windows version. :)

@Carmezim
Copy link
Contributor

@ybsave Regarding Python 3.6 on Windows, is a working in progress, if you want you can follow it on #6999

@Kaushal28
Copy link

I've followed all above suggestions but still getting the same error on windows 8.1

@Carmezim
Copy link
Contributor

Carmezim commented Sep 8, 2017

Hi @Kaushal28 could you try running this script to see what can be happening on your side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants