问题:在windows下,Anaconda环境中,安装tensorflow时遇到ImportError: DLL load failed: 找不到指定的模块 问题。
环境:windows10+Anaconda3+python3.6.5+cuda10.1+cuDNN7.6.4.3,编译器使用VS2017和Pycharm。
本来使用的是pytorch,因为pytorch没有可视化工具,因此想安装tensorboard,要安装tensorboard,需要安装tensorflow。使用pip、conda搞了一天,总算折腾好了。
解决方法:换个版本。。。
尝试安装tensorflow2.1.0各种方法都不成功,虽然tensoeflow官网上写的支持这套环境的是tensorflow2.1.0。一直报的 错误
如图所示:
(base) C:\Users\Administrator>python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "D:\VS_2017\Anaconda3_64\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "D:\VS_2017\Anaconda3_64\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\tensorflow\__init__.py", line 101, in <module>
from tensorflow_core import *
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\tensorflow_core\__init__.py", line 40, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Users\Administrator\AppData\Roaming\Python\Python36\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "D:\VS_2017\Anaconda3_64\lib\importlib\__init__.py"