[英]Tensorflow import is very slow because it's looking for "cudart64_110.dll". I don't have a gpu. Is there a cpu-only version?
[英]I don't have an Nvidia GPU and want to run a Tensorflow model on the CPU. Why does it keep asking for some CUDA DLL?
我遵循了這些指示
具體來說,我想從Github運行下載的Tensorflow模型。 我的計算機上只有一個Intel GPU,因此我想在CPU上執行Tensorflow模型。 如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文件
我嘗試了幾種執行方式,無論是否設置了GPU。 我該如何解決?
tensorlfow有兩個模塊: 'tensorflow','tensorflow-gpu'
在cpu上,您需要使用pip install tensorflow
或conda conda pip install tensorflow
conda install tensorflow
編輯第二個問題:
如果將TensorFlow操作放置在GPU上,則執行引擎必須具有該操作的GPU實現,稱為內核。
如果內核不存在,則放置會導致運行時錯誤。 另外,如果所請求的GPU設備不存在,則會引發運行時錯誤。
最好的處理方法是,如果請求GPU設備導致錯誤,則允許將操作放置在CPU上。
一個答案是刪除所有GPU配置,第二個答案是軟放置,如果如上所述找不到GPU,則使用config.allow_soft_placement = True
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.