airockchip / rknn-toolkit2

Other
847 stars 89 forks source link

rknn_yolov5_demo使用自己训练的模型时出错 #103

Open SeasClouds opened 2 months ago

SeasClouds commented 2 months ago
  1. 我自己训练出来的模型output只有1个,代码中后处理部分需要3个output image
    post_process((int8_t *)outputs[0].buf, (int8_t *)outputs[1].buf, (int8_t *)outputs[2].buf, height, width,
               box_conf_threshold, nms_threshold, pads, scale_w, scale_h, out_zps, out_scales, &detect_result_group);

    2.我尝试修改代码,但在处理output[0]时,在process函数中int8_t prob = in_ptr[(5 + k) * grid_len];这里就会出错

是哪里出问题了 我应该怎么做?

Calsia commented 1 month ago

我跟你的情况差不多,我怀疑是你的 5 或者grid_len不对了,她以前的是对标yolov5的三个层的

Calsia commented 1 month ago

另外我输出的分类置信度都是0,你有遇到过吗

SeasClouds commented 1 month ago

@Calsia 用rk修改过的yolov5导出就是三个output,postprocess.h里面OBJ_CLASS_NUM改成对应数量就不会crash了。没遇到输出的分类置信度都是0,你用训练出来的pt模型detect一下检测正确吗?