Tensorflow, ImportError: DLL load failed while importing _pywrap_tensorflow_internal

    텐서플로우를 최근에 업데이트(2.2)를 한 후 아래와 같이 에러가 발생하였다. 

    ImportError: Traceback (most recent call last):
      File "C:\Users\user\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "C:\Users\user\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
        _pywrap_tensorflow_internal = swig_import_helper()
      File "C:\Users\user\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\user\anaconda3\lib\imp.py", line 242, in load_module
        return load_dynamic(name, filename, file)
      File "C:\Users\user\anaconda3\lib\imp.py", line 342, in load_dynamic
        return _load(spec)
    ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 지정된 모듈을 찾을 수 없습니다.
    
    
    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.
    
    

     

    원인을 찾은 결과, Visual Studio의 파일을 설치하면 되는 것이었다. 

     

    Download the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019. The following updates are the latest supported Visual C++ redistributable packages for Visual Studio 2015, 2017 and 2019. Included is a baseline version of the Universal C Runtime see MSDN for details.
    
    x86: vc_redist.x86.exe
    
    x64: vc_redist.x64.exe
    
    ARM64: vc_redist.arm64.exe
    
    Note Visual C++ 2015, 2017 and 2019 all share the same redistributable files.
    
    For example, installing the Visual C++ 2019 redistributable will affect programs built with Visual C++ 2015 and 2017 also. However, installing the Visual C++ 2015 redistributable will not replace the newer versions of the files installed by the Visual C++ 2017 and 2019 redistributables.
    
    This is different from all previous Visual C++ versions, as they each had their own distinct runtime files, not shared with other versions.

     

    https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

    위 경로에 간 후, vc_redist.x64.exe 파일을 다운로드 받고 설치 한 후 재부팅을 하면 정상적으로 작동이 되는 것을 확인할 수 있었다.

    반응형

    댓글

    Designed by JB FACTORY