Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load ONNX in a framework agnostic way #90

Open
jdiaz97 opened this issue Feb 16, 2024 · 1 comment
Open

Load ONNX in a framework agnostic way #90

jdiaz97 opened this issue Feb 16, 2024 · 1 comment

Comments

@jdiaz97
Copy link

jdiaz97 commented Feb 16, 2024

This library has a very successful way to deal with ONNX files, because of this, I wanted to ask: how much of this codebase could be used to import an ONNX file and parse it into an intermediary Julia object?

I think doing that could help to eventually add support to Lux or other frameworks that could come in the future.

@jdiaz97 jdiaz97 changed the title Load ONNX in a framework agnostic Load ONNX in a framework agnostic way Feb 16, 2024
@DrChainsaw
Copy link
Owner

The CompGraph object returned by load can be seen as an "intermediary Julia object" for all intents and purposes. The NaiveNASlib docs describe it in detail. The quick tutorial has a tl;dr overview.

One way to just get the parameters out is to use the utilities of Functors.jl.

The biggest challenge I see with loading ONNX into a Flux/Lux Chain is to come up with an algorithm that converts a generic graph representation into a Chain. This can often trivially be done manually for each model though.

I also recommend looking into Onnx.jl which also aims at being framework agnostic. I think it supports more ops today compared to ONNXNaiveNASflux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants