Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in predict_shapes: list index out of range #402

Open
hello50505 opened this issue May 9, 2024 · 6 comments
Open

Error in predict_shapes: list index out of range #402

hello50505 opened this issue May 9, 2024 · 6 comments
Labels
question Further information is requested

Comments

@hello50505
Copy link

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

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

@CVHub520
Copy link
Owner

CVHub520 commented May 9, 2024

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

@CVHub520 CVHub520 added the question Further information is requested label May 9, 2024
@hello50505
Copy link
Author

您好,暂不支持动态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文件,但是自动标注还是会报同样的错误

@CVHub520
Copy link
Owner

CVHub520 commented May 9, 2024

您好,暂不支持动态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文件的类别定义完全一致。

@hello50505
Copy link
Author

您好,暂不支持动态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

@CVHub520
Copy link
Owner

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

image

@hello50505
Copy link
Author

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

image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants