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

Discussão em 'Python' iniciado por Stack, Agosto 5, 2025.

  1. Stack

    Stack Membro Participativo

    I installed TensorFlow with CPU support with CUDA Toolkit v9.0 and cuDNNv7.1 and Python 3.6 in Conda enviroment.

    I followed the instructions described in TensorFlow website, and when I tried:

    import tensorflow as tf


    I got this error:

    Traceback (most recent call last):
    File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
    File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
    File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
    return importlib.import_module(mname)
    File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\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.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import * # pylint: disable=redefined-builtin
    File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
    File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
    ImportError: Traceback (most recent call last):
    File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
    File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
    File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in swig_import_helper
    return importlib.import_module(mname)
    File "C:\Users\31121\AppData\Local\conda\conda\envs\tensorflow_gpu\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.


    Did I miss something?

    Continue reading...

Compartilhe esta Página