AILab-CVC / YOLO-World

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

OP "Resize" cannot convert when export tflite ? 转tflite 模型时Resize有问题 #329

Open CYL0089 opened 6 months ago

CYL0089 commented 6 months ago

image ERROR: input_onnx_file_path: work_dirs/yolo_world_v2_s_vlpan_bn_2e-4_80e_8gpus_mask-refine_finetune_coco_ep80-492dc329.onnx ERROR: onnx_op_name: wa/baseModel/neck/upsample_layers.0/Resize ERROR: Read this and deal with it. https://github.com/PINTO0309/onnx2tf#parameter-replacement ERROR: Alternatively, if the input OP has a dynamic dimension, use the -b or -ois option to rewrite it to a static shape and try again. ERROR: If the input OP of ONNX before conversion is NHWC or an irregular channel arrangement other than NCHW, use the -kt or -kat option. ERROR: Also, for models that include NonMaxSuppression in the post-processing, try the -onwdt option.

why the OP "Resize" cannot convert when export tflite ?

wondervictor commented 6 months ago

Hi @CYL0089, considering that you adopt onnx2tf to convert TFLite models, you need remove nms by adding --without-bbox-decoder. Please check: https://github.com/AILab-CVC/YOLO-World/blob/master/docs/tflite_deploy.md

wondervictor commented 6 months ago

Furthermore, I suggest you first re-parameterize the model and then convert it to TFLite.

CYL0089 commented 6 months ago

Hi @CYL0089, considering that you adopt onnx2tf to convert TFLite models, you need remove nms by adding --without-bbox-decoder. Please check: https://github.com/AILab-CVC/YOLO-World/blob/master/docs/tflite_deploy.md Thanks for reply!
I had add the "--without-bbox-decoder" follow your deploy guide, but still account this error. And when I convert onnx, the terminal output is very strange : 企业微信截图_17159334387616 Is the "re-parameterize" step must necessary?

these are my shell script image image

CYL0089 commented 6 months ago

Furthermore, I suggest you first re-parameterize the model and then convert it to TFLite. image I see this part will reparameterize the model when export onnx , so I do not need to reparameterize the model manually?

wondervictor commented 6 months ago

Hi @CYL0089, reparameterizing using the latest script will simplify the architectures and make it smoother to use onnx2tf (onnx2tf might confuse the layouts (NCHW or NHWC) during the process).