YOLO-World
YOLO-World copied to clipboard
Result dismatch between onnx and image_demo.py
I use this config and its weight to run image_demo.py by --text 'person,tree', the result is:
I export this pre-trained model to onnx, and then inference this onnx model, the result is:
As you can see, these scores are different. I have checked that input images are same.
@taofuyu, are the categories the same between the two models?
@taofuyu, are the categories the same between the two models?
yes, when exporting ONNX, I use the same categories as image_demo.py. You could verify this, maybe I mistake something.
infer_onnx.txt
And this is my script to inference onnx, maybe can help someone. It detaches YOLOv5KeepRatioResize and LetterResize from mmyolo, which are used in the test_pipeline of config, to ensure the input of onnx is same as image_demo.py.
Nice work, I'll check it.
updates: a very strange phenomenon, parameters in exported onnx and corresponding checkpoint are different. Take the BN of the first conv layer as an example:
BN and Convolution are fused. See: https://pytorch.org/tutorials/intermediate/custom_function_conv_bn_tutorial.html
Hello, any updates ?
Hi @taofuyu, I'll check it as soon as possible in these days. Please let me know if you have any updates.
Hi, how's it going so far? It's been almost 3 months.
I found this issue on mmdeploy. https://github.com/open-mmlab/mmdeploy/issues/1903 I don't know if there is any direct connection between the two
@wondervictor @taofuyu