Reputation: 79
I followed these instructions
Specifically, I want to run a downloaded Tensorflow model from Github. I only have an Intel GPU on my computer, so I want to execute the Tensorflow model on my CPU. As described here on GitHub, it should be possible by setting the use-gpu parameter to false. So I run this command:
python test_model.py model=iphone_orig dped_dir=dped/ test_subset=full iteration=all resolution=orig use_gpu=false
However, I get the following error, the last two lines indicate that tensorflow tries to run on the GPU, this is the console window:
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.
You find the relevant test_model.py file here
I Tried several executions, with and without GPU setting. What can I do to fix it?
Upvotes: 3
Views: 1368
Reputation: 895
there are two module of tensorlfow:'tensorflow','tensorflow-gpu'
on cpu you need to install tensorlfow with pip install tensorflow
or on conda conda install tensorflow
EDIT for second question:
If a TensorFlow operation is placed on the GPU, then the execution engine must have the GPU implementation of that operation, known as the kernel.
If the kernel is not present, then the placement results in a runtime error. Also, if the requested GPU device does not exist, then a runtime error is raised.
The best way to handle is to allow the operation to be placed on the CPU if requesting the GPU device results in an error.
One answer would be to remove all GPU configs and second would be soft placement if GPU is not found as explained above use config.allow_soft_placement = True
Upvotes: 2