Unable to launch tensorflow 2.0

I am unable to import the tensorflow 2.0 module into my code i end up getting this error

Traceback (most recent call last):
  File "C:\Users\Perseus\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Perseus\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Perseus\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\Perseus\Anaconda3\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Perseus\Anaconda3\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 "C:\Users\Perseus\Anaconda3\lib\runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Users\Perseus\Anaconda3\lib\runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "C:\Users\Perseus\Anaconda3\lib\runpy.py", line 109, in _get_module_details
    __import__(pkg_name)
  File "C:\Users\Perseus\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 27, in <module>
    from tensorflow._api.v2 import audio
  File "C:\Users\Perseus\Anaconda3\lib\site-packages\tensorflow\_api\v2\audio\__init__.py", line 8, in <module>
    from tensorflow.python.ops.gen_audio_ops import decode_wav
  File "C:\Users\Perseus\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\Perseus\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\Perseus\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Perseus\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Perseus\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\Perseus\Anaconda3\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\Perseus\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.

Upvotes: 2

Views: 179

Answers (2)

fisakhan
fisakhan

Reputation: 802

tensorflow 2.0 is now officially available. You can retry. This time it should work without any errors, if CUDA and CuDNN are properly installed.

Upvotes: 0

Giorgos Myrianthous
Giorgos Myrianthous

Reputation: 39810

I think you hit this bug.

You can downgrade tensorflow to v1.10.0

pip install tensorflow-gpu==1.10.0

or make sure that you have these versions for CUDA, Tensorflow and CUDNN:

  • CUDA v9.0
  • tensorflow-gpu v1.12.0
  • CUDNN 7.4.1.5

Alternatively, you can uninstall tensorflow and install it through conda:

pip uninstall tensorflow-gpu
conda install tensorflow-gpu

Upvotes: 1

Related Questions