Search code examples
pythonpytorchtransfer-learningonnxonnxruntime

Couldn't convert pytorch model to ONNX


I used this repo : https://github.com/Turoad/lanedet to convert a pytorch model that use mobilenetv2 as backbone To ONNX but I didn't succeeded.

i got a Runtime error that says:

RuntimeError: Exporting the operator eye to ONNX opset version 12 is not supported. Please open a bug to request ONNX export support for the missing operator.

it's really disappointing, looking to the good result that this model gives and the quick performance that it provides,

is there any way that I can fix this bug? because I need to convert it to ONNX and then to TF lite model to use it in Android App I will provide the pretrained model that I have used and the way that I follow in converting..

Thank you so much for helping!

my colab notebook:

https://colab.research.google.com/drive/18udIh8tNJvti7jKmR4jRaRO-oYDgRmvA?usp=sharing

the pretrained model that I use:

https://drive.google.com/file/d/1o3-BgLIQesurIyDCKGliqbo2inUA5cPw/view?usp=sharing


Solution

  • Use torch>=1.7.0 to convert the model, because operation Eye is added.