Skip to content
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

Win 10: Failed to load native runtime - DLL load failed #23726

Closed
idraper opened this issue Nov 13, 2018 · 7 comments
Closed

Win 10: Failed to load native runtime - DLL load failed #23726

idraper opened this issue Nov 13, 2018 · 7 comments
Assignees
Labels
stat:awaiting response Status - Awaiting response from author type:build/install Build and install issues

Comments

@idraper
Copy link

idraper commented Nov 13, 2018

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Win 10
  • TensorFlow installed from (source or binary): pip install tensorflow
  • TensorFlow version: 1.12.0
  • Python version: 3.6.5
  • Installed using virtualenv? pip? conda?:
  • CUDA/cuDNN version: 10.0 / 7
  • GPU model and memory: Geforce 1050 Ti 8gb

Describe the problem

I am unable to import tensorflow. It gives the error below.

Provide the exact sequence of commands / steps that you executed before running into the problem

  1. Updated my GPU drivers

  2. Installed CUDA 10.0

  3. Downloaded the cuDNN tool

  4. Added both CUDA and cuDNN bin to PATH

  5. pip installed tensorflow-gpu

  6. Tried to import

  7. did pip uninstall tensorflow-gpu

  8. tried pip install tensorflow-gpu==1.10.0 (same error)

Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

Error Shown:

C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\site-packages\sklearn\externals\joblib\externals\cloudpickle\cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
Traceback (most recent call last):
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
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 "ml.py", line 2, in <module>
    from tensorflow import keras
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Mom2\AppData\Local\Programs\Python\Python36\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
@ymodak ymodak self-assigned this Nov 13, 2018
@ymodak ymodak added the type:build/install Build and install issues label Nov 13, 2018
@ymodak
Copy link
Contributor

ymodak commented Nov 13, 2018

TensorFlow officially supports CUDA 9.0. However it is compatible with CUDA 10.0 but not supported currently. For using TF with cuda 10, you have to build it from sources yourself. You can also take a look at installations done by another users to make it work.

@ymodak ymodak added the stat:awaiting response Status - Awaiting response from author label Nov 13, 2018
@idraper
Copy link
Author

idraper commented Nov 14, 2018

No problem, thanks.

Just glancing at the steps for building from source makes me believe simply installing CUDA with version 9.0 will be a faster and easier solution, then I can just (according to this) change the path variables.

Am I correct in that cudnn64_7.dll is the supported version for tensorflow? So I will not need to change that part of the installation?

@ymodak
Copy link
Contributor

ymodak commented Nov 14, 2018

Yes you are correct, cudnn64_7.dll is the supported version for tensorflow. You can also refer the windows setup guide to update the environment variables correctly.

@idraper
Copy link
Author

idraper commented Nov 14, 2018

Perfect, thank you :).

@idraper idraper closed this as completed Nov 14, 2018
@ymodak
Copy link
Contributor

ymodak commented Nov 14, 2018

Are you satisfied with the resolution of your issue?
Yes
No

@MohammadDabbas
Copy link

MohammadDabbas commented Nov 14, 2018

Hi guys, could you help me
I'm getting the same error when I try to import keras: "from keras.models import Sequential"
I installed Anaconda on my machine which has:
Windows 10 64 bit
Anaconda version 5.3.0
and here's the installation command that I did:
1- conda create -n tensorflow python=3.5 anaconda
2- activate tensorflow
3-conda install theano
4- conda install mingw libpython
5- pip install tensorflow
6- pip install keras
then I update all packeges:
conda update --all

then I installed TensorFlow on my GPU:
pip install tensorflow-gpu

and this is the error that I'm getting:

from keras.models import Sequential
Using TensorFlow backend.
Traceback (most recent call last):

File "", line 1, in
from keras.models import Sequential

File "C:\Users\MHD\Anaconda3\lib\site-packages\keras_init_.py", line 3, in
from . import utils

File "C:\Users\MHD\Anaconda3\lib\site-packages\keras\utils_init_.py", line 6, in
from . import conv_utils

File "C:\Users\MHD\Anaconda3\lib\site-packages\keras\utils\conv_utils.py", line 9, in
from .. import backend as K

File "C:\Users\MHD\Anaconda3\lib\site-packages\keras\backend_init_.py", line 89, in
from .tensorflow_backend import *

File "C:\Users\MHD\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 5, in
import tensorflow as tf

File "C:\Users\MHD\Anaconda3\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import

File "C:\Users\MHD\Anaconda3\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow

File "C:\Users\MHD\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)

ImportError: Traceback (most recent call last):
File "C:\Users\MHD\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\MHD\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\MHD\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\MHD\Anaconda3\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\MHD\Anaconda3\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

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

@ymodak
Copy link
Contributor

ymodak commented Nov 14, 2018

@MohammadDabbas Please resubmit your issue using a template from here. We ask users to use the template because it reduces overall time to resolve a new issue by avoiding extra communication to get to the root of the issue. We will close this issue in lieu of the new one you will create from the template. Thank you for your cooperation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response Status - Awaiting response from author type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

3 participants