我在没有 AVX 的 Windows 10 PC 上使用这些命令执行此操作,仅支持 SSE4.2、GTX1060 6GB 和最新驱动程序:
conda create --name tensorflow-2.0 python=3.6
activate tensorflow-2.0
pip install tf-nightly-gpu-2.0-preview
conda install -c anaconda cudatoolkit
conda install -c anaconda cudnn
一切都很好,直到我尝试使用 TensorFlow:
import tensorflow as tf
ImportError: Traceback (most recent call last):
File "C:\Users\Frut\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Frut\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Frut\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\Frut\Anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Frut\Anaconda3\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed: Не найден указанный модуль.
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.
我尝试了另一种方法:
conda remove -n tensorflow-2.0 --all
删除了“Anaconda3\envs”中的文件夹“tensorflow-2.0”
conda create --name tensorflow-2.0 python=3.6
conda activate tensorflow-2.0 && conda install -c anaconda pip
之后没有错误,但活动环境仍然是“base *”
activate tensorflow-2.0
现在活动环境是 tensorflow-2.0
conda install -c anaconda cudatoolkit
conda install -c anaconda cudnn
pip install tensorflow-gpu==2.0.0-alpha0
结果是同样的错误:
import tensorflow as tf
Failed to load the native TensorFlow runtime