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

models returned are generic functions, not Flux models #29

Closed
amckay1 opened this issue Aug 21, 2019 · 2 comments
Closed

models returned are generic functions, not Flux models #29

amckay1 opened this issue Aug 21, 2019 · 2 comments

Comments

@amckay1
Copy link

amckay1 commented Aug 21, 2019

Perhaps I'm missing something big, but the models I'm loading are generic functions, not Flux models, with no trainable params. I tried this on resnet and shufflenet since someone had mentioned in issue #25 that they were able to load that model into Flux but it failed later, but I wasn't able to even get that far.

What am I doing wrong? Running Julia v1.1.1, Flux v0.8.3, ONNX v0.1.1, and following the README:

using Flux, ONNX
ONNX.load_model("model.onnx")
weights = ONNX.load_weights("weights.bson")
model = include("model.jl")

Thank you for your help!

@ayush-1506
Copy link
Member

Sorry for not getting back at the issues raised over the past week on time. Yes, the model from your above code is just a function, not specifically a Flux model. (params(model) will return Params([])). Hence, at the moment the ONNX models can be used only for inference. However, some of the ONNX models have been ported to Metalhead.jl, which maybe be what you're looking for.

@amckay1
Copy link
Author

amckay1 commented Aug 21, 2019

Thanks for the clarification Ayush! Just needed a sanity check, and maybe we should adjust the README.md since by my reading it implied a returned Flux model. I also wonder if with the newest Zygote.jl advances in AD we could make these models trainable, but certainly not a priority :)

@amckay1 amckay1 closed this as completed Aug 21, 2019
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