简体   繁体   English

无法将 pytorch model 转换为 ONNX

[英]Couldn't convert pytorch model to ONNX

I used this repo: https://github.com/Turoad/lanedet to convert a pytorch model that use mobil.netv2 as backbone To ONNX but I didn't succeeded.我使用这个 repo: https://github.com/Turoad/lanedet将使用 mobil.netv2 作为主干的 pytorch model 转换为 ONNX,但我没有成功。

i got a Runtime error that says:我收到一个运行时错误,上面写着:

RuntimeError: Exporting the operator eye to ONNX opset version 12 is not supported. RuntimeError:不支持将操作员眼睛导出到 ONNX opset 版本 12。 Please open a bug to request ONNX export support for the missing operator.请打开一个错误以请求 ONNX 导出支持缺失的运算符。

it's really disappointing, looking to the good result that this model gives and the quick performance that it provides,真的很令人失望,看看这个 model 给出的好结果和它提供的快速性能,

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..因为我需要将它转换为 ONNX,然后转换为 TF lite model 以便在 Android App 中使用它,我将提供我使用过的预训练 model 以及我在转换时遵循的方式。

Thank you so much for helping!非常感谢您的帮助!

my colab notebook:我的 Colab 笔记本:

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

the pretrained model that I use:我使用的预训练 model:

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

Use torch>=1.7.0 to convert the model, because operation Eye is added.使用torch>=1.7.0转换model,因为增加了Eye操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM