--disable_group_convolution

I am trying to export a YOLOv10 model to tflite for use in the NPU of an NXP i.MX8M Plus device. I am unable to build the int8 quantized tflite file and I get the following warning:

WARNING: This model contains GroupConvolution and is automatically optimized for TFLite, but is not output because saved_model does not support GroupConvolution. If saved_model is needed, specify --disable_group_convolution to retransform the model.

Where do I use the --disable_group_convolution option it indicates is necessary? It appears to be related to an onnx2tf library but I don’t know how it relates to the model.export call from Ultralytics.

Thank you

Hello!

It looks like you’re encountering an issue with exporting your YOLOv10 model to TFLite due to the GroupConvolution operation. This is a common challenge when working with certain hardware accelerators like the NPU on the NXP i.MX8M Plus.

To address this, you can try the following steps:

  1. ONNX to TFLite Conversion: The warning suggests using the --disable_group_convolution option during the ONNX to TFLite conversion process. This option is typically used with the onnx2tf tool. You might need to manually convert your ONNX model to TFLite using this tool and specify the option to disable group convolutions.

  2. Exporting with Ultralytics: When using Ultralytics to export your model, ensure you’re following the correct export process. You can refer to the Ultralytics TFLite Export Guide for detailed instructions.

  3. Code Example: If you haven’t already, you can start by exporting your model to ONNX using Ultralytics:

    from ultralytics import YOLO
    
    # Load your YOLOv10 model
    model = YOLO("yolov10.pt")
    
    # Export to ONNX
    model.export(format="onnx")
    
  4. Manual Conversion: After exporting to ONNX, use the onnx2tf tool with the --disable_group_convolution option to convert to TFLite.

If you continue to face issues, please ensure you’re using the latest version of the Ultralytics package. Feel free to check out the Ultralytics documentation for more resources.

I hope this helps! Let us know if you have any more questions :blush:.

ultralytics uses onnx2tf to convert from ONNX to TF format. disable_group_convolution is enabled. Are you using the latest ultralytics ?

1 Like

Hi @Toxite and @pderrenger,

Thank you for your quick replies. Using the latest version of Ultralytics does in fact fix my issue.

Thank you,
Aaron

1 Like