我尝试使用我自己的类和图像重新训练tensorflow初始模型: https://github.com/tensorflow/models/tree/master/research/inception
在将重新训练的模型部署到tensorflow服务之前,它工作正常。 当我尝试推断时,服务器返回类和分数,但显然类与原始ImageNet数据集相关。
string_val: "black widow, Latrodectus mactans"
string_val: "garden spider, Aranea diademata"
string_val: "hammerhead, hammerhead shark"
string_val: "common iguana, iguana, Iguana iguana"
显然我需要自己的课程,但我不知道如何替代它们。
signature_def['predict_images']:
The given SavedModel SignatureDef contains the following input(s):
inputs['images'] tensor_info:
dtype: DT_STRING
shape: (-1)
name: ParseExample/ParseExample:0
The given SavedModel SignatureDef contains the following output(s):
outputs['classes'] tensor_info:
dtype: DT_STRING
shape: (-1, 5)
name: index_to_string_Lookup:0
outputs['scores'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 5)
name: TopKV2:0
Method name is: tensorflow/serving/predict
这是我使用的SavedModel签名。好像我必须更换班级'在部署模型之前用我自己查找,但我无法弄清楚如何做到这一点。