Error while importing Tensorflow. A dynamic link library (DLL) initialization routine failed

Arsalan Younis

I am using tensorflow CPU for a while and decided to install tf gpu and now when i try to import tf it gives me this error. My system specs are: Intel Xeon w5320 2.8 Ghz 8threads. 10 GB Ram Nvidia GTX 1050 2GB I have installed latest drivers, Cuda 9.0 and cuDNN v7.1.3 (April 17, 2018), for CUDA 9.0. Any kind of help is appreciated.

ImportError                               Traceback (most recent call last)
C:\Users\Arsalan\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()
     57 
---> 58   from tensorflow.python.pywrap_tensorflow_internal import *
     59   from tensorflow.python.pywrap_tensorflow_internal import __version__

C:\Users\Arsalan\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in <module>()
     17         return importlib.import_module(mname)
---> 18     _pywrap_tensorflow_internal = swig_import_helper()
     19     del swig_import_helper

C:\Users\Arsalan\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper()
     16         mname = '.'.join((pkg, '_pywrap_tensorflow_internal')).lstrip('.')
---> 17         return importlib.import_module(mname)
     18     _pywrap_tensorflow_internal = swig_import_helper()

C:\Users\Arsalan\Anaconda3\lib\importlib\__init__.py in import_module(name, package)
    125             level += 1
--> 126     return _bootstrap._gcd_import(name[level:], package, level)
    127 

ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-5-fe877e2db533> in <module>()
----> 1 import tensorflow as tf
      2 import numpy as np
      3 import matplotlib.pyplot as plt

C:\Users\Arsalan\Anaconda3\lib\site-packages\tensorflow\__init__.py in <module>()
     22 
     23 # pylint: disable=wildcard-import
---> 24 from tensorflow.python import *  # pylint: disable=redefined-builtin
     25 # pylint: enable=wildcard-import
     26 

C:\Users\Arsalan\Anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>()
     47 import numpy as np
     48 
---> 49 from tensorflow.python import pywrap_tensorflow
     50 
     51 # Protocol buffers

C:\Users\Arsalan\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>()
     72 for some common reasons and solutions.  Include the entire stack trace
     73 above this error message when asking for help.""" % traceback.format_exc()
---> 74   raise ImportError(msg)
     75 
     76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last):
  File "C:\Users\Arsalan\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Arsalan\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Arsalan\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\Users\Arsalan\Anaconda3\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
Alexandre Galdeano

The following script has helped me pinpoint what was wrong on my installation of Tensorflow GPU on Windows: https://gist.github.com/diarabit/17d9051f9505c9d554d8a7d0c2bc4eb1
I hope this will help you too.

Best regards.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

DLL load failed error when importing cv2

From Javascript

Electron Uncaught Error: A dynamic link library (DLL) initialization routine failed

From

Calling Golang from Java using JNI on Windows leads to "A dynamic link library (DLL) initialization routine failed"

From Dev

FMUException: Error loading the binary. Could not load the DLL: A dynamic link library (DLL) initialization routine failed

From Dev

Electron running SQLlite 3 on Windows - A dynamic link library (DLL) initialization routine failed

From Python

Cannot import from pywinauto: ImportError: DLL load failed while importing win32ui: A dynamic link library (DLL) initialization routine failed

From Dev

Error: Dynamic Linking Error: Win32 error 193 while binding to Eztwain3.dll library using nodejs ffi

From Dev

DLL load failed: The specified module could not be found while importing scipy

From Dev

DLL load failed when importing TensorFlow with GPU support

From Dev

Tensorflow : DLL load failed: A dynamic link library (DLL) initialization routine failed

From Dev

"ImportError: DLL load failed while importing _openmp_helpers"?

From Dev

"ImportError: DLL load failed" when importing tensorflow

From Dev

TensorFlow Error: ImportError: DLL load failed with error code 3221225501 while importing _pywrap_ tensorflow_internal in Python3.8

From Dev

Jupyter notebook does not launch (ImportError: DLL load failed while importing)

From Dev

Trying to use win32ui with pywin32 gives: A dynamic link library (DLL) initialization routine failed

From Dev

"ImportError: DLL load failed while importing" while using PyInstaller

From Dev

Server library could not be loaded and the dynamic link library LIBPQ.dll

From Dev

Gradle error while importing library

From Dev

Tensorflow error while importing in Python 2.7

From Dev

error while importing a library in a program

From Dev

How to fix 'ImportError: DLL load failed: The specified procedure could not be found.' while importing tensorflow-gpu?

From Dev

C#: A dynamic link library (DLL) initialization routine failed

From Dev

While importing tensorflow error occurred

From Dev

How to find which DLL failed in "ImportError: DLL load failed while importing" in python?

From Dev

How to fix "DLL load failed while importing QtWidgets"?

From Dev

I have an error while importing tensorflow

From Dev

How to fix Java 15 JNI "UnsatisfiedLinkError: A dynamic link library (DLL) initialization routine failed"

From Dev

Importing library failed: in robotframework

From Dev

Tensorflow installation on Windows: DLL load failed while importing _pywrap_tensorflow_internal

Related Related

  1. 1

    DLL load failed error when importing cv2

  2. 2

    Electron Uncaught Error: A dynamic link library (DLL) initialization routine failed

  3. 3

    Calling Golang from Java using JNI on Windows leads to "A dynamic link library (DLL) initialization routine failed"

  4. 4

    FMUException: Error loading the binary. Could not load the DLL: A dynamic link library (DLL) initialization routine failed

  5. 5

    Electron running SQLlite 3 on Windows - A dynamic link library (DLL) initialization routine failed

  6. 6

    Cannot import from pywinauto: ImportError: DLL load failed while importing win32ui: A dynamic link library (DLL) initialization routine failed

  7. 7

    Error: Dynamic Linking Error: Win32 error 193 while binding to Eztwain3.dll library using nodejs ffi

  8. 8

    DLL load failed: The specified module could not be found while importing scipy

  9. 9

    DLL load failed when importing TensorFlow with GPU support

  10. 10

    Tensorflow : DLL load failed: A dynamic link library (DLL) initialization routine failed

  11. 11

    "ImportError: DLL load failed while importing _openmp_helpers"?

  12. 12

    "ImportError: DLL load failed" when importing tensorflow

  13. 13

    TensorFlow Error: ImportError: DLL load failed with error code 3221225501 while importing _pywrap_ tensorflow_internal in Python3.8

  14. 14

    Jupyter notebook does not launch (ImportError: DLL load failed while importing)

  15. 15

    Trying to use win32ui with pywin32 gives: A dynamic link library (DLL) initialization routine failed

  16. 16

    "ImportError: DLL load failed while importing" while using PyInstaller

  17. 17

    Server library could not be loaded and the dynamic link library LIBPQ.dll

  18. 18

    Gradle error while importing library

  19. 19

    Tensorflow error while importing in Python 2.7

  20. 20

    error while importing a library in a program

  21. 21

    How to fix 'ImportError: DLL load failed: The specified procedure could not be found.' while importing tensorflow-gpu?

  22. 22

    C#: A dynamic link library (DLL) initialization routine failed

  23. 23

    While importing tensorflow error occurred

  24. 24

    How to find which DLL failed in "ImportError: DLL load failed while importing" in python?

  25. 25

    How to fix "DLL load failed while importing QtWidgets"?

  26. 26

    I have an error while importing tensorflow

  27. 27

    How to fix Java 15 JNI "UnsatisfiedLinkError: A dynamic link library (DLL) initialization routine failed"

  28. 28

    Importing library failed: in robotframework

  29. 29

    Tensorflow installation on Windows: DLL load failed while importing _pywrap_tensorflow_internal

HotTag

Archive