简体   繁体   English

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

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

I trained my tf model in python: 我用python训练了我的tf模型:

  with sv.managed_session(master='') as sess:
    with tf.device("/gpu:1"):#my systerm has 4 nvidia cards

and use the command line to abstract the model: 并使用命令行抽象模型:

  freeze_graph.py --clear_devices False

and during test phase, I set the device as follow: 在测试阶段,我将设备设置如下:

  tensorflow::graph::SetDefaultDevice("/gpu:1", &tensorflow_graph);

but someting is wrong: 但有些东西是错误的:

  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

so,how can I use gpu i correctly?? 因此,我如何正确使用GPU?

anyone could help?? 任何人都可以帮忙吗?

Is it possible you're using a version of TensorFlow without GPU support enabled? 您是否可以使用未启用GPU支持的TensorFlow版本? If you're building a binary you may need to add additional BUILD rules from //tensorflow that enable GPU support. 如果您要构建二进制文件,则可能需要从// tensorflow添加其他BUILD规则以启用GPU支持。 Also ensure you enabled GPU support when running configure. 另外,请在运行configure时确保已启用GPU支持。

EDIT : Can you file a bug on TF's github issues with: 编辑 :您可以通过以下方式在TF的github问题上提交错误:

1) your BUILD rule 1)您的BUILD规则

2) much more of your code so we can see how you're building your model and creating your session 2)更多代码,以便我们了解您如何构建模型和创建会话

3) how you ran configure 3)您如何配置

While this API is not yet marked "public"; 虽然此API尚未标记为“公开”; we want to see if there's indeed a bug you are running into so we can fix it. 我们想看看您是否确实遇到了一个错误,以便我们进行修复。

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

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