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

"ImportError: DLL load failed: The specified module could not be found." while trying to import tensorflow in tensorflow_cpu environment. #35988

Closed
Shivani29sheth opened this issue Jan 17, 2020 · 10 comments
Assignees
Labels
stat:awaiting response Status - Awaiting response from author subtype:windows Windows Build/Installation Issues type:build/install Build and install issues

Comments

@Shivani29sheth
Copy link

Traceback (most recent call last): File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\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\Shivani\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_init.py", line 101, in from tensorflow_core import * File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_core_init.py", line 40, in from tensorflow.python.tools import module_util as module_util File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_init.py", line 50, in getattr module = self.load() File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_init.py", line 44, in _load module = importlib.import_module(self.name) File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\importlib_init.py", line 126, in import_module return _bootstrap.gcd_import(name[level:], package, level) File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_core\python_init.py", line 49, in from tensorflow.python import pywrap_tensorflow File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\imp.py", line 243, in load_module return load_dynamic(name, filename, file) File "C:\Users\Shivani\Anaconda3\envs\tensorflow_cpu\lib\imp.py", line 343, in load_dynamic return _load(spec) ImportError: DLL load failed: The specified module could not be found.

@brian1985
Copy link

Having the same issue with what appears to be the same trace. My setup is Pycharm 2019.2 although I have had other versions working previously using Pycharm. Interpreters I have tried are conda and pip through pycharm

@ymodak
Copy link
Contributor

ymodak commented Jan 17, 2020

@Shivani29sheth @brian1985 What is your cpu make/model? TF 1.6 and above requires support for AVX instructions sets.

@gadagashwini-zz gadagashwini-zz self-assigned this Jan 20, 2020
@gadagashwini-zz gadagashwini-zz added subtype:windows Windows Build/Installation Issues type:build/install Build and install issues stat:awaiting response Status - Awaiting response from author labels Jan 20, 2020
@ashcrok
Copy link

ashcrok commented Jan 20, 2020

I am experiencing the same issue, running TF 1.12, tho previously (a few days ago) this was working fine. Any updates?

@brian1985
Copy link

It works now. I am not sure what caused the issue but I believe it was somehow related to Pycharm. I closed the program, restarted Pycharm AND then closed the Ipython terminal at the bottom. After that I assume it forced Pycharm to do something because it then worked.

@ashcrok
Copy link

ashcrok commented Jan 23, 2020

I have switched temporarily to TF-CPU. I will re-switch to GPU in the following days and post here an update.

@gadagashwini-zz
Copy link
Contributor

@Shivani29sheth and @brian1985, Please take a look at support hardware requirements of Tensorflow.
Use Dependency Walker, it will show you the DLL dependency tree, you will find which DLL cause the problem. You can then install the needed library or vcredist version, or add some path to system variable.

@gadagashwini-zz
Copy link
Contributor

@Shivani29sheth, Is this still an issue

@gadagashwini-zz
Copy link
Contributor

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

@tensorflow-bot
Copy link

tensorflow-bot bot commented Feb 6, 2020

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

@ashcrok
Copy link

ashcrok commented Feb 6, 2020

I have switched temporarily to TF-CPU. I will re-switch to GPU in the following days and post here an update.

Re-installed CUDA and CuDNn and everything is fine now. Not sure what was the problem before, as I re-installed the same versions + same tf gpu version.

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 subtype:windows Windows Build/Installation Issues type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

5 participants