rf-detr icon indicating copy to clipboard operation
rf-detr copied to clipboard

Cannot Export to Tesnorflow or Tflite to run on mobile

Open apcarita opened this issue 7 months ago • 7 comments

ONNX-TF only supports up to opset 13 for some operators (like Where), but Your model uses operators (like aten::scaled_dot_product_attention) that are only supported in ONNX opset 14 or higher. Summary of your situation:

If you export with opset 13: PyTorch cannot export your model because it uses newer operators. If you export with opset 16: ONNX-TF cannot convert your model because it does not support some ops at that version.

apcarita avatar Apr 19 '25 17:04 apcarita

@apcarita have you tried this PR for tflite conversion: https://github.com/roboflow/rf-detr/pull/45

dsbyprateekg avatar Apr 22 '25 04:04 dsbyprateekg

seems to work for me, will test on device and update. thanks !

gpokat avatar Apr 22 '25 23:04 gpokat

seems to work for me, will test on device and update. thanks !

how is the performance of the tflite model in mobile device?

dsbyprateekg avatar Apr 26 '25 09:04 dsbyprateekg

Awesome thank you!

apcarita avatar Apr 28 '25 21:04 apcarita

@gpokat do you have any update for us, how it performs on Android with tflite format? Would be very interesting. Thx

stoff99 avatar May 16 '25 08:05 stoff99

Guys, im also very curious, but the latest tests shows that we are lost accuracy during double converting from pytorch to tflite via onnx especially for quantized variant. Tested on qnx and performance is not much bigger then yolov5 with fp16 in compare. Not tested on Android, but here a plenty of work to do before real benchmarking which i have no time for now.

gpokat avatar May 16 '25 14:05 gpokat

Hi guys, Im also very interested in this, do anyone have an update on this?

herjanice avatar Sep 15 '25 03:09 herjanice