# Onnx support for Julia ML frameworks

**URL:** <https://discourse.julialang.org/t/onnx-support-for-julia-ml-frameworks/9035>\
**Category:** Machine Learning\
**Tags:** question\
**Created:** [February 13, 2018, 2:09pm UTC](https://discourse.julialang.org/t/onnx-support-for-julia-ml-frameworks/9035 "2018-02-13T14:09:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![hgeorgako](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hgeorgako/32/5518_2.png) [@hgeorgako](https://discourse.julialang.org/u/hgeorgako)\
**Post date:** [February 13, 2018, 2:09pm UTC](https://discourse.julialang.org/t/onnx-support-for-julia-ml-frameworks/9035/1 "2018-02-13T14:09:53Z")

</div>

This seems like it’s becoming a thing. [https://onnx.ai/getting-started](https://onnx.ai/getting-started)

Any packages providing support for this?

---

<div class="post-metadata">

**Author:** ![amellnik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amellnik/32/137_2.png) [@amellnik](https://discourse.julialang.org/u/amellnik)\
**Post date:** [February 13, 2018, 4:07pm UTC](https://discourse.julialang.org/t/onnx-support-for-julia-ml-frameworks/9035/2 "2018-02-13T16:07:43Z")

</div>

Mike is working on something similar for deeplearn.js [here](https://github.com/FluxML/FluxJS.jl) but I don’t know of any existing work for onnx.

---

<div class="post-metadata">

**Author:** ![hgeorgako](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hgeorgako/32/5518_2.png) [@hgeorgako](https://discourse.julialang.org/u/hgeorgako)\
**Post date:** [February 13, 2018, 4:46pm UTC](https://discourse.julialang.org/t/onnx-support-for-julia-ml-frameworks/9035/3 "2018-02-13T16:46:35Z")

</div>

Thanks for the reference. Getting deep networks deployed onto web/mobile/embedded devices is a hard problem. Mostly, due to lack of a common standard. In the past I played around with pmml files and subsequently [PFA · Portable Format for Analytics](http://dmg.org/pfa/index.html). But it was too hard for me. Hoping for a smoother experience in the near future.

---

<div class="post-metadata">

**Author:** ![pasha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pasha/32/3319_2.png) [@pasha](https://discourse.julialang.org/u/pasha)\
**Post date:** [February 13, 2018, 6:38pm UTC](https://discourse.julialang.org/t/onnx-support-for-julia-ml-frameworks/9035/4 "2018-02-13T18:38:44Z")

</div>

PFA isn’t fully baked yet, and PMML can be frustrating. I had to extend PMML for it to be really useful, but then it wasn’t a standard anymore. The extension was to communicate cutoff thresholds for deployment.

A lot of it comes down to pre- and post-processing needs, rather than communicating the model itself. If you allow that requirement in, it ends up creating an entire new programming/data manipulation language. We didn’t.

A project I’m working on just dropped using PMML for years, in favor of a proprietary JSON format. The main driver in addition to speed was the need to support the communication of model context and version history for governance reasons.

So the question is still wide open on how to communicate models between systems. Lots of people solve it by staying in one system.

---

<div class="post-metadata">

**Author:** ![jwu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jwu/32/3775_2.png) [@jwu](https://discourse.julialang.org/u/jwu)\
**Post date:** [February 13, 2018, 6:44pm UTC](https://discourse.julialang.org/t/onnx-support-for-julia-ml-frameworks/9035/5 "2018-02-13T18:44:26Z")

</div>

there is a new package, but not sure how mature it is.  
[https://github.com/FluxML/ONNX.jl](https://github.com/FluxML/ONNX.jl)

---

<div class="post-metadata">

**Author:** ![natema](https://avatars.discourse-cdn.com/v4/letter/n/ba9def/32.png) [@natema](https://discourse.julialang.org/u/natema)\
**Post date:** [August 24, 2020, 3:10pm UTC](https://discourse.julialang.org/t/onnx-support-for-julia-ml-frameworks/9035/6 "2020-08-24T15:10:43Z")

</div>

2 years since then, and that package seems dead. I tried to use it and [filed an issue](https://github.com/FluxML/ONNX.jl/issues/42), but I don’t see any activity on the code in the last year. There is also [ONNXmutable,](https://github.com/DrChainsaw/ONNXmutable.jl) but that’s also based on ONNX.jl (I don’t know to which extent).

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [August 24, 2020, 4:55pm UTC](https://discourse.julialang.org/t/onnx-support-for-julia-ml-frameworks/9035/7 "2020-08-24T16:55:23Z")

</div>

Seems like there have been a few non-code changes recently. Might be worth pinging @ayush-1506 to clarify?

---

<div class="post-metadata">

**Author:** ![DrChainsaw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/drchainsaw/32/8497_2.png) [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)\
**Post date:** [August 24, 2020, 6:34pm UTC](https://discourse.julialang.org/t/onnx-support-for-julia-ml-frameworks/9035/8 "2020-08-24T18:34:37Z")

</div>

I posted some more info about ONNXmutable in the [announcement thread](https://discourse.julialang.org/t/ann-onnx-export-for-flux-models/33829).

Tl;dr is that ONNXmutable pretty much only uses the protos from ONNX.jl, so aside from some annoying warnings from the deprecated DataFlow package ONNXmutable is fully functional (barring stated limitations and yet undisovered bugs ofc) and a model which can’t be loaded in ONNX.jl might very well load with ONNXmutable.

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [August 24, 2020, 8:24pm UTC](https://discourse.julialang.org/t/onnx-support-for-julia-ml-frameworks/9035/9 "2020-08-24T20:24:16Z")

</div>

I still think it would be good to get an understanding of whether ONNX.jl is actually maintained so that it can be archived or merged with, say, ONNXmutable if not. There are weekly questions about saving/loading where ONNX is brought up, and to have the “official” (i.e. FluxML org) solution non-functional is a bad look (goodness knows we need less ammunition for the “Flux/Julia is not mature enough for real-world use” crowd).

---

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [August 24, 2020, 8:35pm UTC](https://discourse.julialang.org/t/onnx-support-for-julia-ml-frameworks/9035/10 "2020-08-24T20:35:50Z")

</div>

Probably worth stating that in industry ONNX is somewhat of a big deal. Might be a missing cornerstone for many people adopting the toolset. Letting people prototype in julia and export to ONNX could be a foot in the door for some groups. Otherwise, people are wasting a lot of electrons(rebuilding and retraining) or investing pretty heavily in something new (most managers don’t like that).
