我有两台Windows计算机,一台有GPU,一台没有GPU。
我想在两者上部署相同的python脚本(TensorFlow 1.8 Object Detection),而无需更改TensorFlow的打包版本。换句话说,我想在CPU上运行tensorflow-gpu。
在脚本无法检测到的情况下nvcuda.dll,我尝试使用会话配置禁用GPU,如下所示:
config = tf.ConfigProto(
device_count = {'GPU': 0}
)
Run Code Online (Sandbox Code Playgroud)
和:
with tf.Session(graph=detection_graph, config=config) as sess:
Run Code Online (Sandbox Code Playgroud)
但是,这还不够,因为TensorFlow仍然会返回错误:
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.
Run Code Online (Sandbox Code Playgroud)
有什么方法可以完全禁用对GPU / CUDA的检查并默认为CPU?
编辑:我已经阅读了关于此处发布的 Linux上tensorflow-gpu == 1.0的答案,这表明这是不可能的。我很想知道这是否仍然是tensorflow-gpu的编译方式(9个版本以后)。
| 归档时间: |
|
| 查看次数: |
909 次 |
| 最近记录: |