簡體   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