PaddleServing 保存模型 图片变长字段处理
Created by: wangjiawei04
模型是Paddle Detection训练出来的faster_rcnn_r50_1x,出错的流程如下
client发送预测请求
cv2打开图片转ndarray 前处理为 [[image], [im_shape], [im_info]] 然后把这个作为feed_dict {'image': image, 'im_shape': im_shape, 'im_info': im_info} 其中 image是 ndarray shape为 (1228800,) 也就是 3,640,640被拉长成一维。 im_shape是 list [640. ,640. , 1.] im_info 是 list [480. ,640. ,1.]
server端处理出错
进入到服务器端之后,开启GLOG_v=2 卡了一段时间程序退出挂掉了,但没有屏幕打印的错误。 serving日志INFO的最后部分如下
I0409 08:29:39.147490 25438 dag_view.cpp:68] dag view initialized:
node id: 1
node name: general_reader_op
node type: GeneralReaderOp
I0409 08:29:39.148098 25438 dag_view.cpp:48] stage[1] name: workflow1_1
I0409 08:29:39.148114 25438 dag_view.cpp:49] stage[1] node size: 1
I0409 08:29:39.148133 25438 dag_view.cpp:68] dag view initialized:
node id: 2
node name: general_infer_op
node type: GeneralInferOp
I0409 08:29:39.148145 25438 dag_view.cpp:85] set op pre name:
current op name: general_infer_op previous op name: general_reader_op
I0409 08:29:39.148154 25438 dag_view.cpp:48] stage[2] name: workflow1_2
I0409 08:29:39.148162 25438 dag_view.cpp:49] stage[2] node size: 1
I0409 08:29:39.148185 25438 dag_view.cpp:68] dag view initialized:
node id: 3
node name: general_response_op
node type: GeneralResponseOp
I0409 08:29:39.148484 25438 dag_view.cpp:85] set op pre name:
current op name: general_response_op previous op name: general_infer_op
I0409 08:29:39.148510 25438 general_reader_op.cpp:94] var num: 3
I0409 08:29:39.148519 25438 general_reader_op.cpp:96] start to call load general model_conf op
I0409 08:29:39.148526 25438 general_reader_op.cpp:100] get resource pointer done.
I0409 08:29:39.148535 25438 general_reader_op.cpp:104] print general model config done.
I0409 08:29:39.148545 25438 general_reader_op.cpp:125] var[0] has elem type: 1
I0409 08:29:39.148561 25438 general_reader_op.cpp:143] shape for var[0]: 3
I0409 08:29:39.148568 25438 general_reader_op.cpp:147] var[0] is tensor, capacity: 3
I0409 08:29:39.148582 25438 general_reader_op.cpp:125] var[1] has elem type: 1
I0409 08:29:39.148589 25438 general_reader_op.cpp:143] shape for var[1]: 3
I0409 08:29:39.148597 25438 general_reader_op.cpp:147] var[1] is tensor, capacity: 3
I0409 08:29:39.148605 25438 general_reader_op.cpp:125] var[2] has elem type: 1
I0409 08:29:39.148612 25438 general_reader_op.cpp:143] shape for var[2]: 3
I0409 08:29:39.148619 25438 general_reader_op.cpp:147] var[2] is tensor, capacity: 3
I0409 08:29:39.148628 25438 general_reader_op.cpp:178] var[0] is tensor and capacity=3
I0409 08:29:39.148635 25438 general_reader_op.cpp:178] var[1] is tensor and capacity=3
I0409 08:29:39.148643 25438 general_reader_op.cpp:178] var[2] is tensor and capacity=3
client在serving出错后的反应
客户端直接 failed inference call
inference call failed, message: [E112]1/1 channels failed, fail_limit=1 [C0][E1014]Got EOF of fd=3 SocketId=1@127.0.0.1:9292@46642 [R1][E111]Fail to connect SocketId=8589934594@127.0.0.1:9292: Connection refused [R2][E112]Fail to select server from list://127.0.0.1:9292 lb=la
后面还有输入的浮点数信息,在此省略