Reputation: 131
I cannot import tensorflow-gpu==1.13.1 on python 3.6.0.
What i have already done:
Nvidia's drivers (i have GEFORCE 840M which is cuda supported with compute capability 5.0).
I installed Visual Studio 2017 Professional (did not select any specifications in workload).
I installed CUDA 10.1 (was having issues with Visual studio integration so i disabled it during the installation).
I pasted Cudnn 7.5.0 onto cuda's folders.
Restarted.
Pip installed tensorflow-gpu==1.13.1 on python 3.6.0.
but then i cannot import tensorflow at all it shows the error below.
>>> import tensorflow as tf
Traceback (most recent call last):
File "C:\Users\BenBouali\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\BenBouali\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\BenBouali\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\BenBouali\AppData\Local\Programs\Python\Python36\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\BenBouali\AppData\Local\Programs\Python\Python36\lib\imp.py", line 342, 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 "<stdin>", line 1, in <module>
File "C:\Users\BenBouali\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\BenBouali\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\BenBouali\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\BenBouali\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\BenBouali\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\BenBouali\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\BenBouali\AppData\Local\Programs\Python\Python36\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\BenBouali\AppData\Local\Programs\Python\Python36\lib\imp.py", line 342, 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.
>>>
Goal: Obviously being able to import tensorflow and to import keras from the tensorflow library.
Upvotes: 0
Views: 1242
Reputation: 1156
In my case this was an issue with detecting the correct CUDA Toolkit/cuDNN version with tensorflow-gpu==1.13.1
.
After spending 2 hours on this I installed CUDA Toolkit 10.0 and set TF_CUDA_VERSION
environment variable explicitly to 10
in the user env settings (Windows 10).
Upvotes: 1