我正在关注this快速入门指南。我的模型已经过培训,我添加了以下代码片段来导出模型
export_path_base = sys.argv[-1]
export_path = os.path.join("export",export_path_base)
INPUT_TENSOR_NAME = 'x'
def serving_input_receiver_fn():
feature_spec = {INPUT_TENSOR_NAME: tf.FixedLenFeature(dtype=tf.float32, shape=[6])}
return tf.estimator.export.build_parsing_serving_input_receiver_fn(feature_spec)()
classifier.export_savedmodel(export_path, serving_input_receiver_fn)
print('model is exported')
这样我的模型就可以正确导出而不会出现任何错误。但是,当我尝试使用以下命令验证我的模型时
saved_model_cli show --dir export\estimator_one\1508656267 --tag_set serve --signature_def serving_default
它没有显示任何名为'x'
的输入,而是显示以下列表
The given SavedModel SignatureDef contains the following input(s):
inputs['inputs'] tensor_info:
dtype: DT_STRING
shape: (-1)
name: input_example_tensor:0
The given SavedModel SignatureDef contains the following output(s):
outputs['classes'] tensor_info:
dtype: DT_STRING
shape: (-1, 3)
name: dnn/head/Tile:0
outputs['scores'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 3)
name: dnn/head/predictions/probabilities:0
Method name is: tensorflow/serving/classify
我在这里做错了什么或遗失了吗?有人可以指出。