FluxML / FluxML-Community-Call-Minutes

The FluxML Community Team repo
50 stars 4 forks source link

Converting ONNX models to Flux Chains #21

Closed cyborg1995 closed 3 years ago

cyborg1995 commented 3 years ago

Flux chains are easy to work with and most of the models used as starting points for ML tasks can be represented as Flux chains. So, a feature that would take the corresponding ONNX model and convert it directly to Flux chains would be useful.

This would especially be helpful for vision tasks for doing a quick test run of an architecture. Moreover, providing such a feature as part of Metalhead.jl can also be considered.

Such a feature (ONNX2Flux) would be limited in what models it can support (due to Flux chains) but can provide a good starting/testing point for pre-existing ONNX models with ease of use.

If interest exists in creating such a feature (ONNX2Flux.jl), I would be happy to work on it.

Since ONNXmutable.jl already does a good job at converting ONNX to CompGraph, adding support for conversion directly to Flux chains would use that.

Suggestions are welcome. References: This discussion thread https://github.com/FluxML/ML-Coordination-Tracker/issues/10 https://github.com/DrChainsaw/ONNXmutable.jl

ToucheSir commented 3 years ago

As you note, this approach was already discussed in #10. Is there anything to add here that you think wouldn't be relevant to that thread?

cyborg1995 commented 3 years ago

The discussion there is in more general related to ONNX to Flux for all models. Here, I plan to consider only models that can be easily represented by Flux chains.

This issue can be considered as a sub-topic to that discussion. (Although, in the future, this can be further expanded to include all relevant points/features mentioned in that issue.)

But for now, my main focus here is on providing a tool for quick prototyping using already available ONNX models.

ToucheSir commented 3 years ago

I believe the approach we're trying now is to directly track work via PRs on Flux (and related repos) and to move non-tracking discussion (e.g. around design) to discussions. Discussions in particular are nice because you can have multiple sub-topics (e.g. ONNX -> ONNX on Flux Chains). If you already have an idea of what you're planning to write about/track on this issue thread, I can help you to migrate it to one or both of the places above. Then this issue can be closed so that we don't have two duplicate ones about ONNX support.

cyborg1995 commented 3 years ago

Let's move to discussions then ;)