This error occurs because the ONNX-TensorFlow (onnx-tf) backend does not support the Split operator in opset version 18 used by your model. Here's how to resolve this:


Solution 1: Export the ONNX Model with a Lower Opset Version

1. Export the YOLO model to ONNX with opset 13 (supported by onnx-tf):

from ultralytics import YOLO

model = YOLO("yolo11m-pose.pt")
model.export(format="onnx", opset=13)  # Force opset=13 instead of default 17/18

2. Convert the ONNX model to TensorFlow:

import onnx
from onnx_tf.backend import prepare

onnx_model = onnx.load("yolo11m-pose.onnx")
tf_rep = prepare(onnx_model)
tf_rep.export_graph("yolo11m-pose_tf")


Solution 2: Use ONNX Simplifier to Optimize the Model

Simplify the ONNX model to remove unsupported operations:

pip install onnx-simplifier
python -m onnxsim yolo11m-pose.onnx yolo11m-pose_simplified.onnx

Then convert the simplified model:

onnx_model = onnx.load("yolo11m-pose_simplified.onnx")
tf_rep = prepare(onnx_model)
tf_rep.export_graph("yolo11m-pose_tf")


Solution 3: Update Dependencies

Use newer versions of onnx and onnx-tf that might support opset 18:

pip uninstall onnx onnx-tf -y
pip install onnx==1.16.0 onnx-tf==1.17.0  # Newer versions with broader op support


Key Notes

  1. ONNX-TF Compatibility: