2016-11-12 87 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")) 

通常,您会分别保存会话和图表,因为您的服务图可能与训练图不同。