Python 使用tensorflow c+;时,特定gpu设备出现故障+;应用程序编程接口
我用python训练了我的tf模型:Python 使用tensorflow c+;时,特定gpu设备出现故障+;应用程序编程接口,python,c++,tensorflow,gpu,Python,C++,Tensorflow,Gpu,我用python训练了我的tf模型: with sv.managed_session(master='') as sess: with tf.device("/gpu:1"):#my systerm has 4 nvidia cards 并使用命令行抽象模型: freeze_graph.py --clear_devices False 在测试阶段,我将设备设置为: tensorflow::graph::SetDefaultDevice("/gpu:1", &ten
with sv.managed_session(master='') as sess:
with tf.device("/gpu:1"):#my systerm has 4 nvidia cards
并使用命令行抽象模型:
freeze_graph.py --clear_devices False
在测试阶段,我将设备设置为:
tensorflow::graph::SetDefaultDevice("/gpu:1", &tensorflow_graph);
但有点不对劲:
ould not create Tensorflow Graph:
Invalid argument: Cannot assign a device to node '.../RNN_backword/while/Enter':
Could not satisfy explicit device specification '/gpu:1'
because no devices matching that specification are registered in this process;
available devices: /job:localhost/replica:0/task:0/cpu:0
那么,如何正确使用gpu I
任何人都可以提供帮助???您是否可以在未启用GPU支持的情况下使用TensorFlow版本?如果要构建二进制文件,可能需要从//tensorflow添加其他构建规则,以支持GPU。同时确保在运行configure时启用了GPU支持 编辑:您能否通过以下方式对TF的github问题提出错误: 1) 您的构建规则 2) 更多的代码,我们可以看到您是如何构建模型和创建会话的 3) 如何运行配置
虽然此API尚未标记为“公共”;我们想看看您是否确实遇到了一个bug,以便我们可以修复它。非常感谢,您的建议非常有用,bazel build--config=cuda&更改cc_库的deps工作