Ethan's Blog

记录和思考

TensorFlow 2.1 ImportError DLL load failed 问题的解决办法

如果在 Windows 下安装使用 TensorFlow 2.1 正式版,可能会在导入 TensorFlow 时出现 DLL 载入错误 。此时安装 Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 即可正常使用。

错误详情:

ImportError: DLL load failed: The specified module could not be found.
ImportError: DLL load failed: 找不到指定的模块。
Failed to load the native TensorFlow runtime.

Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 下载地址:

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

下载安装完成后,重启电脑即可。