Tag Archives: Failed to load the native TensorFlow runtime

[Solved] Tensorflow:ImportError: DLL load failed: The specified module cannot be found Failed to load the native TensorFlow runtime

Configuration: Windows 10

python3.6

CUDA 10.1

CUDNN 7.6.0

tensorflow 1.12

Process: Import tensorflow as TF , and then report an error:

Traceback (most recent call last):

  File "<ipython-input-6-64156d691fe5>", line 1, in <module>
    import tensorflow as tf

  File "C:\Users\HonorVan\AppData\Roaming\Python\Python36\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import

  File "C:\Users\HonorVan\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow

  File "C:\Users\HonorVan\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)

ImportError: Traceback (most recent call last):
  File "C:\Users\HonorVan\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\HonorVan\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\HonorVan\AppData\Roaming\Python\Python36\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:\ProgramData\Anaconda3\lib\imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "D:\ProgramData\Anaconda3\lib\imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module cannot 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.

During this period, trying to re install CUDA and cudnn has no effect, and demoting CUDA and cudnn also reports the same error

Then I plan to re install tensorflow, use PIP universal tensorflow GPU = = 1.12.0 to uninstall tensorflow GPU, and then use CONDA list to check and find that there is still tensorflow GPU, and there are no less other dependencies. At this time, I re import tensorflow and find that the error has been solved…

Failed to load the native TensorFlow runtime [Solved]

Preface

Due to the recent hard disk failure, a hard disk has been replaced, and the system has been re installed. The system version is windows 10 Pro 1703. After installing the system, I installed docker and python 3.5.3, and then used PIP install tensorflow . If there is no accident, I can Import tensorflow as TF , but unfortunately, it reported a mistake – failed to load the native tensorflow runtime . This makes me puzzled. Why did the installation go wrong

Solution steps

After multi-party search, it seems that some dependencies are not installed properly

Using pip to install tensorflow: PIP install tensorflow install tensorflow

Download Visual C + + redistribute 2015 x64 and install. Click me to download, if the address is invalid, please download by yourself

PIP installs numpy + MKL. In order to ensure stable download, WHL download is provided here. Click me to download numpy-1.13.0 + mkl-cp35-cp35m-win_ amd64.whl

After downloading, open the folder, enter PIP install in CMD, then drag WHL in the folder to CMD, and press enter to run

PIP can install SciPy by PIP install SciPy , or by using WHL. Click me to download scipy-0.19.0-cp35-cp35m-win_ amd64.whl

After downloading, open the folder, enter PIP install in CMD, then drag WHL in the folder to CMD, and press enter to run

Open the CMD and enter PIP install Matplotlib

Enter Python in CMD, and then enter Import tensorflow as TF you will find that this error is no longer reported

Postscript

I have encountered this error once, but that is a special case. Under tensorflow source code, if you use CMD to enter Python and import tensorflow, you will report this error. If you go out of CD, you will not report an error