Python Google Cloud ML引擎在线预测错误:为已包含的占位符张量输入一个值
我已经面临以下错误好几天了,仍然无法拿出解决方案: InvalidArgumentError(回溯见上文):必须为带有dtype float和shape[?,?,1]的占位符张量“decoder_input”输入一个值 [[节点解码器输入(定义于/Users/me/Downloads/google cloud sdk/lib/third_party/ml_sdk/cloud/ml/prediction/frameworks/tf_prediction_lib.py:210)]] (错误代码:2) 我训练了我的Python Google Cloud ML引擎在线预测错误:为已包含的占位符张量输入一个值,python,tensorflow,google-cloud-platform,tensorflow-serving,google-cloud-ml,Python,Tensorflow,Google Cloud Platform,Tensorflow Serving,Google Cloud Ml,我已经面临以下错误好几天了,仍然无法拿出解决方案: InvalidArgumentError(回溯见上文):必须为带有dtype float和shape[?,?,1]的占位符张量“decoder_input”输入一个值 [[节点解码器输入(定义于/Users/me/Downloads/google cloud sdk/lib/third_party/ml_sdk/cloud/ml/prediction/frameworks/tf_prediction_lib.py:210)]] (错误代码:2)
tf.keras.Model
(Python 3.6,Tensorflow 1.13.1)并成功地将其导出到Google Cloud ML引擎
通过运行saved\u model\u cli show--all--dir=trainer/predict dir/1552642125
我得到:
MetaGraphDef with tag-set: 'serve' contains the following SignatureDefs:
signature_def['serving_default']:
The given SavedModel SignatureDef contains the following input(s):
inputs['decoder_input'] tensor_info:
dtype: DT_FLOAT
shape: (-1, -1, 1)
name: decoder_input_1:0
inputs['encoder_input'] tensor_info:
dtype: DT_FLOAT
shape: (-1, -1, 1)
name: encoder_input_1:0
The given SavedModel SignatureDef contains the following output(s):
outputs['reg_sequence_prediction'] tensor_info:
dtype: DT_FLOAT
shape: (-1, -1, 1)
name: reg_sequence_prediction/BiasAdd:0
Method name is: tensorflow/serving/predict
我的instances.json
文件是:
[代码>>[译码器的输入端:“[译码器的输入端][编码>[代码>>[编码.译码器的输入端][译码器的输入端][0.0.0 0.0][0.0 0 0.0][0.0][0.0][0.0][0.0][0.0][0.0][0.0、[0.0.0][0][0、[0.0.0.0][0、[0.0、[0.0.0][0.0、[0.0.0、[0.0][0][0.0][0、[0.0.0][0][0.0][0、[0.0][0.0][0][0、[0.1.1.1671.1.1672][1.1.1672][1.1672][1.1672][1.1.1.],-1.1672]}
正如您所看到的,我包含了两个必要的输入值,但仍然收到相同的错误
我没有包括任何退出或正则化层,该模型是一个简单的seq2seq keras模型,带有RNN和GruCell
提前感谢您的帮助。使用
tf.estimator.export.build\u raw\u serving\u input\u receiver\u fn()
而不是tf.estimator.export.servingingputreceiver()。希望使用tf.estimator.export.build\u raw\u serving\u input\u receiver\u fn()
而不是tf.estimator.export.servingingputreceiver()
来帮助解决这个问题。希望能有帮助