2016-11-12 107 views
0

在選擇存儲桶和文件夾後爲模型創建新版本期間,我從雲控制檯收到此錯誤。模型目錄應包含'export.meta'文件

{ 
    "error": { 
    "code": 400, 
    "message": "Field: version.deployment_uri Error: The model directory gs://ml-codelab/v1-output/ is expected to contain the 'export.meta' file. Please make sure it exists and Cloud ML service account [email protected] has read access to it", 
    "status": "FAILED_PRECONDITION", 
    "details": [ 
     { 
     "@type": "type.googleapis.com/google.rpc.BadRequest", 
     "fieldViolations": [ 
      { 
     "field": "version.deployment_uri", 
     "description": "The model directory gs://ml-codelab/v1-output/ is expected to contain the 'export.meta' file. Please make sure it exists and Cloud ML service account [email protected] has read access to it" 
      } 
     ] 
     } 
    ] 
    } 
} 

回答

1

您需要在導出模型時創建元圖。您可以使用保存程序來執行此操作。

saver = tf.train.Saver() 
saver.save(sess, os.path.join(FLAGS.output_dir, "export")) 

通常,您會分別保存會話和圖表,因爲您的服務圖可能與訓練圖不同。