我遵循了這個很棒的教程并成功地訓練了一個模型(在 CloudML 上)。我的代碼也進行離線預測,但現(xiàn)在我正在嘗試使用 Cloud ML 進行預測并遇到一些問題。為了部署我的模型,我遵循了本教程?,F(xiàn)在我有一個生成TFRecordsvia的代碼,apache_beam.io.WriteToTFRecord我想對這些TFRecords. 為此,我正在關注這篇文章,我的命令如下所示:gcloud ml-engine jobs submit prediction $JOB_ID --model $MODEL --input-paths gs://"$FILE_INPUT".gz --output-path gs://"$OUTPUT"/predictions --region us-west1 --data-format TF_RECORD_GZIP但我只得到錯誤: 'Exception during running the graph: Expected serialized to be a scalar, got shape: [64]似乎它需要不同格式的數(shù)據(jù)。我在這里找到了 JSON 的格式規(guī)范,但找不到如何使用 TFrecords 來實現(xiàn)。更新:這是輸出 saved_model_cli show --all --dirMetaGraphDef with tag-set: 'serve' contains the following SignatureDefs:signature_def['prediction']: The given SavedModel SignatureDef contains the following input(s): inputs['example_proto'] tensor_info: dtype: DT_STRING shape: unknown_rank name: input:0 The given SavedModel SignatureDef contains the following output(s): outputs['probability'] tensor_info: dtype: DT_FLOAT shape: (1, 1) name: probability:0 Method name is: tensorflow/serving/predictsignature_def['serving_default']: The given SavedModel SignatureDef contains the following input(s): inputs['example_proto'] tensor_info: dtype: DT_STRING shape: unknown_rank name: input:0 The given SavedModel SignatureDef contains the following output(s): outputs['probability'] tensor_info: dtype: DT_FLOAT shape: (1, 1) name: probability:0 Method name is: tensorflow/serving/predict
添加回答
舉報
0/150
提交
取消