PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.78k stars 2.89k forks source link

PaddleDetection导出Serving模型错误 #906

Closed cqzhao closed 4 years ago

cqzhao commented 4 years ago

https://aistudio.baidu.com/aistudio/projectdetail/520573 使用上面的项目训练了blazeface模型,训练结果保存在work/PaddleDetection/output中。 已经能够成功导出模型。然后尝试导出serving模型:

python tools/export_serving_model.py -c ../../work/blazeface.yml --output_dir=serving_model -o weights=./output/blazeface/model_final

导出后再serving_model/blazeface/serving_server文件夹下查看cat serving_client_conf.prototxt :

feed_var {
  name: "image"
  alias_name: "image"
  is_lod_tensor: false
  feed_type: 1
  shape: 3
}
fetch_var {
  name: "detection_output_0.tmp_0"
  alias_name: "detection_output_0.tmp_0"
  is_lod_tensor: false
  fetch_type: 1
  shape: 6
}

可以看到feed变量的image的shape只有3. 应该是3维变量。 请问是什么问题? AiStudio的项目能够复现问题

cqzhao commented 4 years ago

我按照imagenet的例子能够成功部署了。在服务端需要将图片调整为channel first。但是返回的结果应该是错误的。返回结果维度为[1,750,6],但是查看里面的x1,y1,x2,y2等数据均有1E10级别的数据。应该是错误的。

qingqing01 commented 4 years ago

@wangjiawei04 please help to solve this issue.

qingqing01 commented 4 years ago

@cqzhao 最新的代码提供了示例,关闭了此issue