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

Win10: ImportError: DLL load failed: The specified module could not be found #22794

Closed
damcclane opened this Issue Oct 6, 2018 · 94 comments

Comments

Projects
None yet
@damcclane
Copy link

damcclane commented Oct 6, 2018

System information:

Have I written custom code: No
OS Platform and Distribution: Windows 10 Pro updated
Mobile device: None
TensorFlow installed from: pip install
TensorFlow version: 1.11.0
Python Version: 3.6.6
Bazel version: not installed
CUDA/cuDNN version: CUDA 9.0, cuDNN 8.0
GPU model and memory: GF-GTX970 STRIX
Exact command to reproduce:
pip install tensorflow
pip install tensorflow-gpu
python
import tensorflow as tf

Problem

I have had this error consistently even after trying to downgrade to older versions of CUDA tool, cuDNN, python, tensorflow and tensorflow-gpu. I have updated my enviornment variables. I have installed Visual C++ Redistributable Update.
I have read and tried to follow the solutions from other similar issues (such as #10033 and #17101), but have not succeeded in fixing the problem.

Log

C:\Users\user>python
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
<> import tensorflow as tf
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\user\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\user\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\user\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 "", line 1, in
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_init_.py", line 22, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\user\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\user\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\user\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\user\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.

@tensorflowbutler

This comment has been minimized.

Copy link
Member

tensorflowbutler commented Oct 6, 2018

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks.
Mobile device

@damcclane

This comment has been minimized.

Copy link
Author

damcclane commented Oct 6, 2018

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks.
Mobile device

Ok done.

@kennedyCzar

This comment has been minimized.

Copy link

kennedyCzar commented Oct 7, 2018

I had the same issue while trying to use tensorflow-gpu on windows 10.
Since i couldn't get it to work on cuDNN10..i opted for 9 instead using...

conda create --name tf-gpu
conda install -c aaronzs tensorflow-gpu
conda install -c anaconda cudatoolkit
conda install -c anaconda cudnn
conda install keras-gpu

you can also check the fullpost on https://www.pugetsystems.com/labs/hpc/The-Best-Way-to-Install-TensorFlow-with-GPU-Support-on-Windows-10-Without-Installing-CUDA-1187/

Credit to Dr Donald Kinghorn

@umitkilic

This comment has been minimized.

Copy link

umitkilic commented Oct 15, 2018

I have same problem with you @damcclane . How did you solve ?

Win10 x64, python 3.6, cuda9 with cudnn 7.0.5 and also Win10 x64, python 3.7, cuda10 with cudnn 7.3.1

Both has the same problem. My graphic card is Nvidia GeForce 1050 Ti

@CorentinJ

This comment has been minimized.

Copy link

CorentinJ commented Oct 15, 2018

Same issue. Win10 x64, python 3.5, tensorflow-gpu 1.11.0, CUDA 8 with CUDNN 6 installed.

@starcream

This comment has been minimized.

Copy link

starcream commented Oct 16, 2018

Same problem,Win10 x64,python 3.6 ,cuda 9 with cudnn 7.0

@henry-huynh-3508

This comment has been minimized.

Copy link

henry-huynh-3508 commented Oct 17, 2018

Same problem, anyone knows how to solve this?

@tcllst

This comment has been minimized.

Copy link

tcllst commented Oct 17, 2018

Same problem here… :(

@CorentinJ

This comment has been minimized.

Copy link

CorentinJ commented Oct 17, 2018

I've had this issue in the past and it was because I had the wrong version of CUDNN. You could try downloading a few of them and see if any of those work.

@ymodak

This comment has been minimized.

Copy link
Contributor

ymodak commented Oct 17, 2018

I would like to encourage all who are facing this issue to create a new issue on TensorFlow repo so that we can focus on solving your problem on individual basis since the system config can vary from person to person. Thanks!

@tcllst

This comment has been minimized.

Copy link

tcllst commented Oct 17, 2018

@umitkilic

This comment has been minimized.

Copy link

umitkilic commented Oct 18, 2018

I installed CUDA9 and cuDNN 7.0.5 again and restarted the computer. The related problem has just gone.

@Darshu1315

This comment has been minimized.

Copy link

Darshu1315 commented Oct 20, 2018

I am using Cuda10 and cudaNN 7.3.1.20 and i got the following error can someone tell the solution @tensorflowbutler
Traceback (most recent call last):
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Darshan\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\Darshan\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Darshan\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 "", line 1, in
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_init_.py", line 22, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Darshan\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Darshan\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\Darshan\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Darshan\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.

@iteratorlee

This comment has been minimized.

Copy link

iteratorlee commented Oct 24, 2018

Same issue, Windows 10 x64, python3.5, tensorflow-gpu 1.11.0, CUDA 10.0, cudnn 7.3.1, my graphics card is GTX 1070Ti

@ymodak

This comment has been minimized.

Copy link
Contributor

ymodak commented Oct 24, 2018

@iteratorlee

I would like to encourage all who are facing this issue to create a new issue on TensorFlow repo so that we can focus on solving your problem on individual basis since the system config can vary from person to person. Thanks!

@catruck

This comment has been minimized.

Copy link

catruck commented Oct 24, 2018

Same problem, on cuda 10, when I install anaconda I have missed the PyHamcrest, after I install "pip install PyHamcrest" all worked fine until today. I get the same error.

@mragon2

This comment has been minimized.

Copy link

mragon2 commented Oct 27, 2018

I am facing the same issues. The problem appears also in importing another package named PyQSTEM for electron microscopy simulation. If someone can find a way to fix the problem, could please share here the solution? Thanks

@BirdeeChen

This comment has been minimized.

Copy link

BirdeeChen commented Nov 7, 2018

Same issue, Windows 10 x64, python3.5, tensorflow-gpu 1.11.0, CUDA 10.0, cudnn 7.3.1, my graphics card is GTX 1070Ti

Same issue, and I tried to install CUDA 9.0, but NVIDIA inform me the driver is not compatible graphic hardware, but with CUDA 10.0, there is no such warning.

@BirdeeChen

This comment has been minimized.

Copy link

BirdeeChen commented Nov 8, 2018

Lucky, Issue solved when getting visual studio 2017 with C++ package installed, Windows 10 x64, python3.6.7, tensorflow-gpu 1.11.0, cudnn 7.3.1, both cuda 9.0 & cuda 10.0 installed(not checking which is the right one), my graphics card is GTX 1070Ti.

@57ar7up

This comment has been minimized.

Copy link

57ar7up commented Nov 12, 2018

I just downgraded TensorFlow to 1.10.0 and it worked

pip install tensorflow-gpu==1.10.0

@WuYunfan

This comment has been minimized.

Copy link

WuYunfan commented Nov 14, 2018

I finally solve the problem by installing cuda 9.0 instead of 9.2 or 10.0 with tensorflow 1.12.0 and cudnn 7.4.1.5

@boldt

This comment has been minimized.

Copy link

boldt commented Nov 14, 2018

I can confirm, that the following assembly does not work on Windows 10:

  • tensorflow 1.12.0
  • cuda toolkit 10.0.130
  • cudnn 7.4.1.5

Additional infos:

  • NVIDIA Quadro P1000 with NVIDIA driver 411.81
  • Microsoft Visual C++ 2015 Redistributable 14.0.24215 (C:\Windows\system32\msvcp140.dll exists)
  • Python 3.6.7

I also get the message

ImportError: DLL load failed: The specified module could not be found.

Unfortunately, it does not say which module is missed.

[EDIT]

Just realized, that you write:

TensorFlow supports CUDA 9.0.

I'll reinstall now.

@sssmayank

This comment has been minimized.

Copy link

sssmayank commented Nov 20, 2018

Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Program Files\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:\Program Files\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Program Files\Python36\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: %1 is not a valid Win32 application.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\ABC\Desktop\pyprograms\tensorflowbasic\1.py", line 1, in
import tensorflow as tf
File "C:\Program Files\Python36\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Program Files\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Program Files\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:\Program Files\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Program Files\Python36\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: %1 is not a valid Win32 application.

@levicki

This comment has been minimized.

Copy link

levicki commented Nov 25, 2018

My install:

Windows 10.0.17763.134 x64
NVIDIA Driver 416.92
CUDA 10.0.130
CUDNN 7.4.1.5 for CUDA 10.0
Python 3.6.7
GeForce GTX 1080 Ti

The cause of this error seems to be people installing Python without Tcl/Tk support not realizing that Tcl is necessary for SWIG and module imports. I just tested this and in my case it was not enough to modify the Python installation to add Tcl/Tk -- I had to delete everything and install from scratch and now I am not getting the error anymore.

TL;DR -- just fully remove and reinstall Python with Tcl/Tk option selected.

@sulaimanvesal

This comment has been minimized.

Copy link

sulaimanvesal commented Nov 27, 2018

After spending almost two days, I finally solved the problem by installing:

  • cuda 9.0 instead of 9.2 or 10.0
  • tensorflow1.12.0
  • cudnn 7.4.1.5

Thanks to @WuYunfan 💯

@jerryhluo

This comment has been minimized.

Copy link

jerryhluo commented Mar 2, 2019

Ran into the same problem.

If you are using Anaconda (Python 3.6), highly suggest to use conda instead of pip. It usually takes care of EVERYTHING: conda install tensorflow-gpu

(base) C:\Users>conda install tensorflow-gpu
Solving environment: done

## Package Plan ##

  environment location: D:\Software\Anaconda3

  added / updated specs:
    - tensorflow-gpu


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    cudnn-7.3.1                |        cuda9.0_0       170.9 MB
    grpcio-1.12.1              |   py36h1a1b453_0         1.4 MB
    tensorflow-base-1.12.0     |gpu_py36h6e53903_0       180.8 MB
    conda-4.6.7                |           py36_0         1.7 MB
    tensorflow-1.12.0          |gpu_py36ha5f9131_0           4 KB
    keras-preprocessing-1.0.5  |           py36_0          52 KB
    gast-0.2.2                 |           py36_0         138 KB
    keras-applications-1.0.6   |           py36_0          49 KB
    tensorboard-1.12.0         |   py36he025d50_0         3.1 MB
    termcolor-1.1.0            |           py36_1           8 KB
    absl-py-0.7.0              |           py36_0         157 KB
    protobuf-3.6.0             |   py36he025d50_0         517 KB
    cudatoolkit-9.0            |                1       339.8 MB
    tensorflow-gpu-1.12.0      |       h0d30ee6_0           3 KB
    markdown-3.0.1             |           py36_0         125 KB
    _tflow_select-2.1.0        |              gpu           3 KB
    libprotobuf-3.6.0          |       h1a1b453_0         2.0 MB
    astor-0.7.1                |           py36_0          44 KB
    ------------------------------------------------------------
                                           Total:       700.7 MB

If you already messed up the versions, try to use conda remove or pip uninstall to delete packages, including tensorflow-gpu and tensorflow. Or remove Anaconda and reinstall it.

@zerychao

This comment has been minimized.

Copy link

zerychao commented Mar 4, 2019

I have the same question with the author,and i solve it now.
window 10
python 3.6.2
gpu rtx2080
my problem is the version of CUDA and the cudnn does not fit each other.
2019/3/3 today the newest version of CUDA is 10.1 but there isn't a corresponding version of cudnn.
so i changed the CUDA 10.0 and reinstall the tensorflow,it works now!

@parkerdu Savior! My system is running Python 3.7.1 on Windows 10 and my GPU is RTX 2080 Ti. All I did was downgrading CUDA from 10.1 to 10.0 and it now works. But I'm a little confused with what you mean by

the newest version of CUDA is 10.1 but there isn't a corresponding version of cudnn.

since there is a version of cuDNN released on Feb 25, 2019 according to https://developer.nvidia.com/rdp/cudnn-download . It doesn't work with the latest version of TensorFlow installed through "pip install tensorflow-gpu" in my case but it's there. I'm wondering why it's not the

corresponding version of cudnn.

Again, thanks for your solution.

@parkerdu

This comment has been minimized.

Copy link

parkerdu commented Mar 4, 2019

I have the same question with the author,and i solve it now.
window 10
python 3.6.2
gpu rtx2080
my problem is the version of CUDA and the cudnn does not fit each other.
2019/3/3 today the newest version of CUDA is 10.1 but there isn't a corresponding version of cudnn.
so i changed the CUDA 10.0 and reinstall the tensorflow,it works now!

@parkerdu Savior! My system is running Python 3.7.1 on Windows 10 and my GPU is RTX 2080 Ti. All I did was downgrading CUDA from 10.1 to 10.0 and it now works. But I'm a little confused with what you mean by

the newest version of CUDA is 10.1 but there isn't a corresponding version of cudnn.

since there is a version of cuDNN released on Feb 25, 2019 according to https://developer.nvidia.com/rdp/cudnn-download . It doesn't work with the latest version of TensorFlow installed through "pip install tensorflow-gpu" in my case but it's there. I'm wondering why it's not the

corresponding version of cudnn.

Again, thanks for your solution.

you are right! I haven't see the latest version of cudnn. Thanks for your point.

@Cristy94

This comment has been minimized.

Copy link

Cristy94 commented Mar 4, 2019

After hours of installing different versions I finally managed to make it work, this is my final setup:

  • Python 3.6.8
  • Tensorflow 1.13
  • CUDA 10
  • cuDNN v7.5.0 (Feb 21, 2019), for CUDA 10.0

I tried with CUDA 10.1 but didn't work, switched to 10.0 and it finally worked.

@steven12138

This comment has been minimized.

Copy link

steven12138 commented Mar 6, 2019

python 3.7.2
Tensorflow-gpu 2.0.0a0
tensorboard 1.13.0
tensorflow-estimator 1.13.0
CUDA 10.1
cuDNN v7.5.0 for CUDA10.0
win10 x64
Please help

@CharlesCCC

This comment has been minimized.

Copy link

CharlesCCC commented Mar 6, 2019

@steven12138 You can follow the previous post that worked.
AFAIK, the python 3.7.X python is not supported.

@Murtadha44

This comment has been minimized.

Copy link

Murtadha44 commented Mar 6, 2019

This is what worked for me on Window 10 and for GPU NVIDIA GeForce RTX 2080 Ti:
Python 3.5 (3.6 did not work)
Tensorflow-gpu 1.13 (or tf-nightly-gpu)
CUDA 10
cuDNN for CUDA 10.0
The problem was because of using python 3.6. Using Python 3.5 solved it.

@b-z

This comment has been minimized.

Copy link

b-z commented Mar 8, 2019

CUDA 9.0
cudnn 7.0.5
Windows 10
tf 1.12.0
failed...no idea


solved,
one problem is the PATH is incorrect, I corrected it but the problem still exists.
Then I downgrade the tf to 1.10.0, and it works.

@aqua1907

This comment has been minimized.

Copy link

aqua1907 commented Mar 8, 2019

Ran into the same problem.

If you are using Anaconda (Python 3.6), highly suggest to use conda instead of pip. It usually takes care of EVERYTHING: conda install tensorflow-gpu

(base) C:\Users>conda install tensorflow-gpu
Solving environment: done

## Package Plan ##

  environment location: D:\Software\Anaconda3

  added / updated specs:
    - tensorflow-gpu


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    cudnn-7.3.1                |        cuda9.0_0       170.9 MB
    grpcio-1.12.1              |   py36h1a1b453_0         1.4 MB
    tensorflow-base-1.12.0     |gpu_py36h6e53903_0       180.8 MB
    conda-4.6.7                |           py36_0         1.7 MB
    tensorflow-1.12.0          |gpu_py36ha5f9131_0           4 KB
    keras-preprocessing-1.0.5  |           py36_0          52 KB
    gast-0.2.2                 |           py36_0         138 KB
    keras-applications-1.0.6   |           py36_0          49 KB
    tensorboard-1.12.0         |   py36he025d50_0         3.1 MB
    termcolor-1.1.0            |           py36_1           8 KB
    absl-py-0.7.0              |           py36_0         157 KB
    protobuf-3.6.0             |   py36he025d50_0         517 KB
    cudatoolkit-9.0            |                1       339.8 MB
    tensorflow-gpu-1.12.0      |       h0d30ee6_0           3 KB
    markdown-3.0.1             |           py36_0         125 KB
    _tflow_select-2.1.0        |              gpu           3 KB
    libprotobuf-3.6.0          |       h1a1b453_0         2.0 MB
    astor-0.7.1                |           py36_0          44 KB
    ------------------------------------------------------------
                                           Total:       700.7 MB

If you already messed up the versions, try to use conda remove or pip uninstall to delete packages, including tensorflow-gpu and tensorflow. Or remove Anaconda and reinstall it.

this guy saved a day, thank you

@liyzcj

This comment has been minimized.

Copy link

liyzcj commented Mar 8, 2019

I use virtualenv with python 3.6.8, and just run
pip install tensorflow-gpu

cuda 9.0
cudnn 7.4.1 for cuda 9.0
python 3.6.8
tensorflow 1.12.0
visual C ++ 2015 redistribution

This Configuration works.
Attention, tensorflow 1.13 not works for me with this configuration.

=========================Edit================
As I've tried again.
If you want use tensorflow 1.13.1, you can refer to the configuration below:
cuda 10.0
cudnn 7.5.0 for cuda 10.0
python 3.6.8
tensorflow 1.13.1
visual C++ redistribution 2015 or 2017

And i find , the official site said that tensorflow only support cuda 9 now, but actually it is already update to CUDA 10 , you can find on the release note at github.

so simplicity, CUDA 9.0 ( cudnn 7.4.1) == > tensorflow 1.12.0
CUDA 10.0 (cidnn 7.5.0)== > tensorflow 1.13.1

@JamesQFreeman

This comment has been minimized.

Copy link

JamesQFreeman commented Mar 11, 2019

python 3.7.2
Tensorflow-gpu 2.0.0a0
tensorboard 1.13.0
tensorflow-estimator 1.13.0
CUDA 10.1
cuDNN v7.5.0 for CUDA10.0
win10 x64
Didn't work

@MeetDevin

This comment has been minimized.

Copy link

MeetDevin commented Mar 12, 2019

I have no problem at the terminal, but I have this problem on pycharm, I hope I can give you a reference.

Win10+python 3.6+cuda 10.0+cudnn 7.5+tensorflow 1.13.1

@devrohitraj

This comment has been minimized.

Copy link

devrohitraj commented Mar 12, 2019

I had same issue. I resolved it by uninstalling tensorflow-gpu and reinstalling through conda.

conda install tensorflow-gpu

@saidmengi

This comment has been minimized.

Copy link

saidmengi commented Mar 12, 2019

I had a problem

TypeError: Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file "object_detection/protos/post_processing.proto":
object_detection/protos/post_processing.proto: Import "object_detection/protos/calibration.proto" has not been loaded.
object_detection.protos.PostProcessing.calibration_config: "object_detection.protos.CalibrationConfig" seems to be defined in "protos/calibration.proto", which is not imported by "object_detection/protos/post_processing.proto". To use it here, please add the necessary import.

@Rakshith1342

This comment has been minimized.

Copy link

Rakshith1342 commented Mar 13, 2019

I just downgraded TensorFlow to 1.10.0 and it worked

pip install tensorflow-gpu==1.10.0

When I ran the pip install tensorflow-gpu command, 1.13.0 got installed and I got the error Win10: ImportError: DLL load failed: The specified module could not be found. So I tried downgrading to 1.10.0 as @57ar7up suggested. This did not work as pip could not find the required .whl file and the connection kept timing out.

So I followed @WuYunfan 's approach and 1.12.0 worked.

I finally solve the problem by installing cuda 9.0 instead of 9.2 or 10.0 with tensorflow 1.12.0 and cudnn 7.4.1.5

Finally my setup is:

  • Nvidia GTX 1070
  • CUDA 9.0 with the 4 patches (This installed GeForce drivers 385.54)
  • CuDNN v7.5.0.56 (for CUDA 9.0)
  • TF GPU 1.12.0

I guess 1.13.0 is to be used for CUDA 10.0

@xiaocc612

This comment has been minimized.

Copy link

xiaocc612 commented Mar 17, 2019

Python 3.6.4 |Anaconda custom (64-bit)| (default, Jan 16 2018, 10:22:32) [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 "D:\MLandBigData\Anaconda3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\MLandBigData\Anaconda3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\MLandBigData\Anaconda3.5\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 "D:\MLandBigData\Anaconda3.5\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "D:\MLandBigData\Anaconda3.5\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "D:\MLandBigData\Anaconda3.5\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "D:\MLandBigData\Anaconda3.5\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "D:\MLandBigData\Anaconda3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "D:\MLandBigData\Anaconda3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\MLandBigData\Anaconda3.5\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\MLandBigData\Anaconda3.5\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 "D:\MLandBigData\Anaconda3.5\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "D:\MLandBigData\Anaconda3.5\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。

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.

@qualia0000

This comment has been minimized.

Copy link

qualia0000 commented Mar 18, 2019

python 3.7.1
Tensorflow-gpu 1.13.1

CUDA 8.0
cuDNN v7.1.4 for CUDA 8.0
win10 x64
Please help

I built the tensorflow from source with environments following and worked:
python 3.7.1
Tensorflow-gpu 1.13.1

CUDA 9.1
cuDNN v7.0.5 for CUDA 9.1
win10 x64

@EvanMata

This comment has been minimized.

Copy link

EvanMata commented Mar 18, 2019

My error message is copied a few lines down. I have tried some of the solutions that seemed to work for other people, but did not have them work for me. Specifically:
Always python 3.6.8 & Windows 10 & Visual Studios 2017 & Quadro M1000M GPU
Used pip to install tensorflow-gpu 1.13.1
After reading I found out that CUDA 10.1 (which I tried originally) doesn't work with anything, so I switched to CUDA 10.0. With CUDA 10.0 I tried cudNN 7.4.2 & 7.5.0. Neither works, I still have CUDA 10.1 installed (does tensorflow automatically try both, or do I need to set it to use 10.0 somehow?).

I have previously uninstalled & reinstalled tensorflow-gpu a few times (also plain tensorflow - which does not detect my GPU), though tensorflow-gpu was always installed for my tests. This is also my first time working with either CUDA or cudNN, so I'm not 100% sure I "installed" cudNN correctly (from extracted cudNN folders bin, lib & include copy the relevant file over to the Cuda bin, lib & inc folders). I also installed tf-nightly-gpu, as that worked with one solution.

Error message:

Python 3.6.8rc1 (v3.6.8rc1:cc3e73212a, Dec 12 2018, 00:15:46) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import tensorflow as tf
Traceback (most recent call last):
File "C:\Users\601969\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\601969\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\601969\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\601969\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\601969\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 "", line 1, in
File "C:\Users\601969\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow_init_.py", line 28, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\601969\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\601969\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\601969\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\601969\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\601969\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\601969\AppData\Local\Programs\Python\Python36\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\601969\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.

@xiaocc612

This comment has been minimized.

Copy link

xiaocc612 commented Mar 19, 2019

Same issue. Win10 x64, python 3.6, tensorflow-gpu 1.12.0, CUDA 10.1 with CUDNN 10.1 installed.

@exitsky

This comment has been minimized.

Copy link

exitsky commented Mar 19, 2019

I use virtualenv with python 3.6.8, and just run
pip install tensorflow-gpu

cuda 9.0
cudnn 7.4.1 for cuda 9.0
python 3.6.8
tensorflow 1.12.0
visual C ++ 2015 redistribution

This Configuration works.
Attention, tensorflow 1.13 not works for me with this configuration.

=========================Edit================
As I've tried again.
If you want use tensorflow 1.13.1, you can refer to the configuration below:
cuda 10.0
cudnn 7.5.0 for cuda 10.0
python 3.6.8
tensorflow 1.13.1
visual C++ redistribution 2015 or 2017

And i find , the official site said that tensorflow only support cuda 9 now, but actually it is already update to CUDA 10 , you can find on the release note at github.

so simplicity, CUDA 9.0 ( cudnn 7.4.1) == > tensorflow 1.12.0
CUDA 10.0 (cidnn 7.5.0)== > tensorflow 1.13.1

Thank you. solved my issue
my setting
Win10 + python 3.6.6 + GeForce GTX 1050 Ti (Legion Notebook)
Visual Studio Community 2017 + CUDA 10.0 (cudnn 7.5.0) + tensorflow 1.13.1

@sudob

This comment has been minimized.

Copy link

sudob commented Mar 19, 2019

Overall, getting the basic validation test to work for tensorflow-gpu (1.13.1) is a big ordeal -- don't know where exactly the utterly useless DLL load error message comes from...

Noting down my parameters (as of 03/18/2019) in case it helps any brave soul !
Base framework: Windows 10 Pro/64, Anaconda 3-5.1.0 (python 3.6.4),
Visual Studio 2017 [GPU=RTX2060]
Unsuccessful target setup that throws the DLL error:
CUDA 10.1 + corresponding cuDNN (7.5.0.56)
What seems to work (after resolving minor glitch with numpy version in anaconda)
CUDA 10.0 + cuDNN 7.4.1.5

@MRYingLEE

This comment has been minimized.

Copy link

MRYingLEE commented Mar 19, 2019

I tried with CUDA 10.1 but all version combinations didn't work, then I switched to CUDA 10.0 as someone suggested and it finally worked. So I guess the problem lies at the CUDA 10.1.

My successful version combinations are:

CUDA 10.0 (NOT CUDA 10.1)
cuDNN v7.5.0 (Feb 21, 2019), for CUDA 10.0 (NOT the one for CUDA 10.1)
Annaconda Anaconda 2018.12 (with Python 3.7 version, 64-Bit Graphical Installer)

Then I tested 2 combinations: Python 3.7.1 + Tensorflow 1.13.1 and Python 3.68 + Tensorflow 2.0.0-alpha0. They both work.

BTW, I used
conda install tensorflow-gpu
instead of
pip install tensorflow-gpu
to install tensorflow as someone suggested.

Good luck.

@MrPiavushka

This comment has been minimized.

Copy link

MrPiavushka commented Mar 20, 2019

i had the same issue using (conda install tensorflow-gpu) solve the problem.
cuda 10.0
cudnn 7.41.5 for cuda 10.0
python 7.1

@pf-xu

This comment has been minimized.

Copy link

pf-xu commented Mar 20, 2019

I just downgraded TensorFlow to 1.10.0 and it worked

pip install tensorflow-gpu==1.10.0

yes, it works. mark!

@NexYY

This comment has been minimized.

Copy link

NexYY commented Mar 20, 2019

I have the same question with the author,and i solve it now.
window 10
python 3.6.2
gpu rtx2080
my problem is the version of CUDA and the cudnn does not fit each other.
2019/3/3 today the newest version of CUDA is 10.1 but there isn't a corresponding version of cudnn.
so i changed the CUDA 10.0 and reinstall the tensorflow,it works now!

Hi, I have the same setup with python 3.7.
Now there is a cudnn version of CUDA 10.1, however tensorflow-gpu still doesn't work if I install it from pip.
Did you rebuild it yourself?

Edit.: Found the issue. Even tho there is a cudNN version from nvidia to support CUDA 10.1, there is no python library to support CUDA 10.1. This library is installed as a dependency with tensorflow-gpu, but only supports CUDA 10.0.

@supersidor

This comment has been minimized.

Copy link

supersidor commented Mar 21, 2019

I just installed latest conda 3.7
run "conda install tensorflow-gpu" in anaconda promt
no need to install cuda, cudann and mess with PATH variables
everything works

@devnoname120

This comment has been minimized.

Copy link

devnoname120 commented Mar 21, 2019

I can confirm that CUDA 10.1 does not work. But then, tensorflow never claimed it did and its guide asks to download CUDA 10.0.

For those who can't find this version, it's available in the NVIDIA archives and here is a direct link: https://developer.nvidia.com/cuda-10.0-download-archive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.