繁体   English   中英

使用Tensorflow C ++ API时,特定的GPU设备失败

[英]specificy gpu devices failed when using tensorflow c++ api

我用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", &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?

任何人都可以帮忙吗?

您是否可以使用未启用GPU支持的TensorFlow版本? 如果您要构建二进制文件,则可能需要从// tensorflow添加其他BUILD规则以启用GPU支持。 另外,请在运行configure时确保已启用GPU支持。

编辑 :您可以通过以下方式在TF的github问题上提交错误:

1)您的BUILD规则

2)更多代码,以便我们了解您如何构建模型和创建会话

3)您如何配置

虽然此API尚未标记为“公开”; 我们想看看您是否确实遇到了一个错误,以便我们进行修复。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM