gpt4 book ai didi

python : cannot import tensorflow-gpu

转载 作者:太空宇宙 更新时间:2023-11-03 15:48:51 25 4
gpt4 key购买 nike

我按照本 link 中介绍的步骤,在我的机器上成功地使用 Anaconda3 创建了我的 tensorflow 环境。 .但是当我尝试做的时候:

>>> import tensorflow as tf

我收到以下错误消息:OSError 和 ImportError。

Traceback (most recent call last):
File "C:\Users\Froilan\Anaconda3\envs\tensorflow\lib\site-
packages\tensorflow\python\platform\self_check.py", line 75, in preload_check
ctypes.WinDLL(build_info.cudart_dll_name)
File "C:\Users\Froilan\Anaconda3\envs\tensorflow\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] This specified module could not be found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Froilan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
from tensorflow.python import *
File "C:\Users\Froilan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Froilan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "C:\Users\Froilan\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\platform\self_check.py", line 82, in preload_check
% (build_info.cudart_dll_name, build_info.cuda_version_number))
ImportError: Could not find 'cudart64_80.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Download and install CUDA 8.0 from this URL: https://developer.nvidia.com/cuda-toolkit

会不会是我cpu的问题?我用锐龙1700。+ GPU:GTX 1050 Ti - 比 1080 ti 差一点..但我听说 GPU 仍然比 CPU 好得多。

最佳答案

您需要先安装 CUDA 库,我建议您点击此链接:

https://gist.github.com/mjdietzx/0ff77af5ae60622ce6ed8c4d9b419f45

更新:对于 Windows 操作系统,请遵循以下方法:

http://blog.nitishmutha.com/tensorflow/2017/01/22/TensorFlow-with-gpu-for-windows.html

关于 python : cannot import tensorflow-gpu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48060769/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com