-
Notifications
You must be signed in to change notification settings - Fork 2
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
Error exporting a model with Flux.GlobalMeanPool() operation #87
Comments
I had to check the code myself, but it seems that serialization of Flux built in global pools is not implemented. Iirc the deserialization implementation as well as the statement that it is supported is from before Flux had its own global pools and just told users to build their own (e.g. from Max/MeanPool). It should be pretty easy to add though. Just add the methods somewhere here and just directly call the functions below. Just be mindful if there is a difference between what Flux does and what ONNX thinks the global pools does described somewhere here, for example w.r.t dropping the spatial dimensions. The second argument to the |
Ok, I've added the appropriate methods and the script in the description is able to save and load the model. See #88 There's still a warning thrown
and the |
Update: the However, some good news, running
I'm happy with this solution, but interested to know if that warning can be addressed before merging the PR. |
Took a look at the warning and it is correct to warn here so no action is needed. The reason for the warning is this:
To avoid the warning, you can just supply the input sizes when loading the model:
or when saving:
The input sizes are only used when using the NaiveNASlib features to do parameter pruning or other NAS-like things which is why the model seems to work just fine for inference (and should work fine for training too). There are only a few op-types which need the size info so chances are that the NaiveNASlib stuff would work as well even if input sizes are not inferred. Since it would be quite difficult to understand the reason for the error you get if you try to change the dimension of some parameter when this info is missing I decided to always print the warning by default. |
Great, thanks for the context! I'll update my calling code with a size parameter. |
Fixed in #88 |
Here's a simple script to test exporting and importing a model
Error returned:
GlobalAveragePool is listed as a supported operation in the docs, but it doesn't seem to work for me. Is it a name change issue?
The text was updated successfully, but these errors were encountered: