rknpu2 icon indicating copy to clipboard operation
rknpu2 copied to clipboard

RV1106 PaddleOCRV2 检测模型输出为空

Open Basicname opened this issue 1 year ago • 1 comments

测试平台:RV1106G3 RKNPU2 RKNN-Toolkit版本均为1.5.2,在官方的1.5.2 docker环境下测试

推理部分日志: D RKNNAPI: Input tensors: D RKNNAPI: index=0, name=x, n_dims=4, dims=[1, 64, 512, 3], n_elems=98304, size=98304, w_stride = 0, size_with_stride = 0, fmt=NHWC, type=UINT8, qnt_type=AFFINE, zp=-13, scale=0.018385 D RKNNAPI: Output tensors: D RKNNAPI: index=0, name=save_infer_model/scale_0.tmp_1, n_dims=4, dims=[1, 1, 64, 512], n_elems=32768, size=32768, w_stride = 0, size_with_stride = 0, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922 W inference: The 'data_format' has not been set and defaults is nhwc! [] D NPUTransfer: Transfer client closed, fd = 3

推理部分代码: print('shape:{} type:{}'.format(img_part.shape, img_part.dtype)) img_part = (img_part * 255).astype(np.uint8) # convert float32 to uint8 #img_part = np.transpose(img_part np.save('det_time_in0.npy', img_part) outs_part = self.onet_det_session.inference(inputs=[img_part]) post_res_part = self.det_re_process_op(outs_part[0], shape_part_list) dt_boxes_part = post_res_part[0]['points'] dt_boxes_part = self.filter_tag_det_res(dt_boxes_part, img_ori.shape) dt_boxes_part = self.sorted_boxes(dt_boxes_part) print(dt_boxes_part)

Netron查看模型结构为: screen

img_part dtype为uint8,shape为(1, 64, 512, 3) 完整工程: rknn2_ocr.zip

从这个repo https://github.com/yinghanguan/PaddleOCR2RKNN 修改而来,原repo是rknn-toolkit1的

请大佬们指点一二!

Basicname avatar Nov 19 '23 15:11 Basicname

PS: onnx输出结果是正常的

Basicname avatar Nov 20 '23 15:11 Basicname