X-AnyLabeling icon indicating copy to clipboard operation
X-AnyLabeling copied to clipboard

Error in predict_shapes: list index out of range

Open hello50505 opened this issue 1 year ago • 6 comments

1.我使用这个命令得到我的onnx文件: python3 export_yoloV8.py -w best.pt -s 1280 960 --dynamic (best.pt是我自己训练得到的yolov8s模型,class=1)

2.我在x-anylabeling使用自动标注,配置文件如下: type: yolov8 name: yolov8s-r20230520 display_name: YOLOv8s Ultralytics model_path: /home/xpc/Downloads/video_20240508_144952/best.onnx nms_threshold: 0.45 confidence_threshold: 0.25 input_width: 1280 input_height: 960 classes:

  • dingzi

3.当我点击推理图片的按钮后,命令窗口报错: Error in predict_shapes: list index out of range

请问问题出在哪里?谢谢!

hello50505 avatar May 09 '24 01:05 hello50505

您好,暂不支持动态batch,可注释掉--dynamic参数重新导出。

CVHub520 avatar May 09 '24 02:05 CVHub520

您好,暂不支持动态batch,可注释掉--dynamic参数重新导出。

我把导出的命令改为: python3 export_yoloV8.py -w best.pt -s 1280 960 或者python3 export_yoloV8.py -w best.pt -s 1280 960 --batch 1

能正常导出onnx文件,但是自动标注还是会报同样的错误

hello50505 avatar May 09 '24 02:05 hello50505

您好,暂不支持动态batch,可注释掉--dynamic参数重新导出。

我把导出的命令改为: python3 export_yoloV8.py -w best.pt -s 1280 960 或者python3 export_yoloV8.py -w best.pt -s 1280 960 --batch 1

能正常导出onnx文件,但是自动标注还是会报同样的错误

使用netron工具检查下你的onnx模型中classes类别是否与yaml文件的类别定义完全一致。

CVHub520 avatar May 09 '24 07:05 CVHub520

您好,暂不支持动态batch,可注释掉--dynamic参数重新导出。

我把导出的命令改为: python3 export_yoloV8.py -w best.pt -s 1280 960 或者python3 export_yoloV8.py -w best.pt -s 1280 960 --batch 1 能正常导出onnx文件,但是自动标注还是会报同样的错误

使用netron工具检查下你的onnx模型中classes类别是否与yaml文件的类别定义完全一致。

Screenshot from 2024-05-09 19-48-36 我自己看好像是没什么问题,class=1

hello50505 avatar May 09 '24 11:05 hello50505

你这个输出节点没对应上,建议使用官方的导出设置。如果你仍然需要使用自定义的导出模型,可自行修改后处理代码进行适配。

image

CVHub520 avatar May 10 '24 01:05 CVHub520

你这个输出节点没对应上,建议使用官方的导出设置。如果你仍然需要使用自定义的导出模型,可自行修改后处理代码进行适配。

image

好的谢谢!我按照yolov8官方方法导出,目前可以自动标注了

hello50505 avatar May 10 '24 03:05 hello50505