Page 1 of 1

rk1103自建AI模型运行异常

Posted: 2024-07-29 17:02
by lansnow
根据文档 《RKNN 推理测试》进行自建模型的推理。最后在使用模型时出现异常如下:

Code: Select all

# ./rknn_yolov5_demo model/yolov5.rknn model/bus.jpg
load lable ./model/coco_80_labels_list.txt
model input num: 1, output num: 3
input tensors:
  index=0, name=images, n_dims=4, dims=[1, 640, 640, 3], n_elems=1228800, size=1228800, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
output tensors:
  index=0, name=output0, n_dims=4, dims=[1, 80, 80, 24], n_elems=153600, size=153600, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003911
  index=1, name=286, n_dims=4, dims=[1, 40, 40, 24], n_elems=38400, size=38400, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
  index=2, name=288, n_dims=4, dims=[1, 20, 20, 24], n_elems=9600, size=9600, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003916
input_attrs[0].size_with_stride=1228800
model is NHWC input fmt
model input height=640, width=640, channel=3
origin size=640x640 crop size=640x640
input image: 640 x 640, subsampling: 4:2:0, colorspace: YCbCr, orientation: 1
scale=1.000000 dst_box=(0 0 639 639) allow_slight_change=1 _left_offset=0 _top_offset=0 padding_w=0 padding_h=0
src width=640 height=640 fmt=0x1 virAddr=0x0xa5c77000 fd=11
dst width=640 height=640 fmt=0x1 virAddr=0x(nil) fd=3
src_box=(0 0 639 639)
dst_box=(0 0 639 639)
color=0x72
rga_api version 1.10.1_[0]
rknn_run
Segmentation fault (core dumped)
有哪位有遇到上面的情况并解决的,麻烦给个提示或是建议。谢谢

Re: rk1103自建AI模型运行异常

Posted: 2024-07-30 2:06
by Crocodile
您好,请检查源码中识别物体种类的多少是否设置正确 ./model/coco_80_labels_list.txt 中是否修改为您准备识别的种类名称(顺序需要对应训练源码的设置)

Re: rk1103自建AI模型运行异常

Posted: 2024-07-30 15:02
by lansnow
完全根据文档中的配置,自己构建的一个模型,模型测试也能正常通过
3.png
模型转换成是正常的
2.png
构建程序也是正常的
3.png
但移动到设备中就出现问题了,麻烦帮忙看下是哪里的问题。转格式前的.pt文件如附件。这个文件在python里也是验证正常的。

Re: rk1103自建AI模型运行异常

Posted: 2024-07-30 15:06
by lansnow
Crocodile wrote: 2024-07-30 2:06 您好,请检查源码中识别物体种类的多少是否设置正确 ./model/coco_80_labels_list.txt 中是否修改为您准备识别的种类名称(顺序需要对应训练源码的设置)
这个没什么问题,更改后,也是还是一样的问题。

Re: rk1103自建AI模型运行异常

Posted: 2024-08-01 10:31
by lansnow
问题解决了,有个坑而已

Re: rk1103自建AI模型运行异常

Posted: 2024-08-01 11:08
by Crocodile
您好,方便分享一下您是怎么解决的吗?