AILab-CVC / YOLO-World

[CVPR 2024] Real-Time Open-Vocabulary Object Detection
https://www.yoloworld.cc
GNU General Public License v3.0
4.33k stars 418 forks source link

export to onnx model failed. #466

Open shiboyang opened 1 month ago

shiboyang commented 1 month ago

export command:

PYTHONPATH=./ python deploy/export_onnx.py /home/shiby/PycharmProjects/YOLO-World/configs/pretrain/yolo_world_v2_l_clip_large_vlpan_bn_2e-3_100e_4x8gpus_obj365v1_goldg_train_lvis_minival.py /home/shiby/Downloads/yolo_world_v2_l_clip_large_o365v1_goldg_pretrain-8ff2e744.pth --custom-text /home/shiby/PycharmProjects/YOLO-World/prompt.json --opset 11

output logs: Export ONNX with bbox decoder and NMS ... Loads checkpoint by local backend from path: /home/shiby/Downloads/yolo_world_v2_l_clip_large_o365v1_goldg_pretrain-8ff2e744.pth INFO:lvis.lvis:Loading annotations. INFO:lvis.lvis:Creating index. INFO:lvis.lvis:Index created. <bound method DistancePointBBoxCoder.decode of <mmyolo.models.task_modules.coders.distance_point_bbox_coder.DistancePointBBoxCoder object at 0x72af6b0fd670>> <bound method DistancePointBBoxCoder.decode of <mmyolo.models.task_modules.coders.distance_point_bbox_coder.DistancePointBBoxCoder object at 0x72af6b0fd670>> ONNX export success, save into ./work_dirs/yolo_world_v2_l_clip_large_o365v1_goldg_pretrain-8ff2e744.onnx

prompt.json file content: [["Sculpture"],["Church"],["Mountain"],["River"],["Lake"],["Bridge"],["Castle"],["Beach"],["Park"],["Modern_building"],["Monuments"],["Historical_building"],["Museum"],["Square"],["Ancient_building"],["Fountain"]]

But the finally i get this onnx model struction: image

I don't know where I went wrong, hope you can help me. Thinks a lot.

Tingelam commented 4 weeks ago

0.0 i have same error with default config. add --without-nms can export a true onnx with network but onnx-demo result is wrong. still debugging....

shiboyang commented 4 weeks ago

0.0 i have same error with default config. add --without-nms can export a true onnx with network but onnx-demo result is wrong. still debugging.... 是的 导出不带有后处理的onnx是可以成功的,我使用onnx_demo运行成功了,代码中的后处理有点问题,需要自己修改一下 image 这应该是一个bug

Tingelam commented 4 weeks ago

改完了才看到QAQ

shiboyang commented 4 weeks ago

改完了才看到QAQ

你测试导出batch推理了吗?