【发布时间】:2019-12-04 02:01:21
【问题描述】:
具体来说,我想运行从 Github 下载的 Tensorflow 模型。我的电脑上只有一个 Intel GPU,所以我想在我的 CPU 上执行 Tensorflow 模型。如here on GitHub 所述,应该可以通过将 use-gpu 参数设置为 false 来实现。所以我运行这个命令:
python test_model.py model=iphone_orig dped_dir=dped/ test_subset=full iteration=all resolution=orig use_gpu=false
但是,我收到以下错误,最后两行表明 tensorflow 尝试在 GPU 上运行,这是控制台窗口:
C:\Users\username\Downloads\DPED-master\DPED-master>python test_model.py model=iphone_orig dped_dir=dped/ test_subset=full iteration=all resolution=orig use_gpu=false
Traceback (most recent call last):
File "C:\Users\username\Downloads\WPy64-3720\python-3.7.2.amd64\lib\site-packages\tensorflow\python\platform\self_check.py", line 62, in preload_check
ctypes.WinDLL(build_info.nvcuda_dll_name)
File "C:\Users\username\Downloads\WPy64-3720\python-3.7.2.amd64\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Das angegebene Modul wurde nicht gefunden
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test_model.py", line 5, in <module>
import tensorflow as tf
File "C:\Users\username\Downloads\WPy64-3720\python-3.7.2.amd64\lib\site-packages\tensorflow\__init__.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "C:\Users\username\Downloads\WPy64-3720\python-3.7.2.amd64\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "C:\Users\username\Downloads\WPy64-3720\python-3.7.2.amd64\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 30, in <module>
self_check.preload_check()
File "C:\Users\username\Downloads\WPy64-3720\python-3.7.2.amd64\lib\site-packages\tensorflow\python\platform\self_check.py", line 70, in preload_check
% build_info.nvcuda_dll_name)
ImportError: Could not find 'nvcuda.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Typically it is installed in 'C:\Windows\System32'. If it is not present, ensure that you have a CUDA-capable GPU with the correct driver installed.
你找到相关的test_model.py文件here
我尝试了几次执行,有无 GPU 设置。我能做些什么来解决它?
【问题讨论】:
-
你是如何在你的系统上安装 tensorflow 的?链接的文章执行以下操作:
pip install tensorflow-gpu明确安装了 TF GPU 请检查此 [年龄](tensorflow.org/install/pip) 或直接执行pip install tensorflow -
可能是因为您安装了
tensorflow-gpu。尝试安装 tensorflow 的常规版本
标签: python tensorflow gpu cpu