Is your feature request related to a problem? Please describe.
The current model loading does not appear to handle deserializing SlimmableContainer from JSON. This includes the standard A2 model format being shared by users and creators. I am currently experimenting with some ideas building on A2 models, and I would like to be able to load trained models back into a pytorch environment for evaluation, etc.
Describe the solution you'd like
I would like _from_nam.py to handle SlimmableContainer as it does other serialized model types. I created PR #693 that extended the types there with the A2/PackedWaveNet case, but @sdatkinson pointed out that the format is more flexible than that, i.e. is not bijective with PackedWaveNet. He suggested raising this issue instead.
Assuming the SlimmableContainer format is sufficiently self-describing, it seems reasonable for the comprehensive solution to aim for a more general deserialization approach, proceeding piecewise through the config. If SlimmableContainer could in principle contain further SlimmableContainer, recursion seems like a natural fit. Some adjustment of the interior parsing may be needed for the weights being placed other than at the top level.
Describe alternatives you've considered
One workaround to handle the A2/PackedWaveNet case would be to deserialize that config only in an initial patch, throwing an exception for an incompatible config.
Additional context
I am fairly easily able to workaround this issue by using code similar to #693 in my project. But not supporting round trips in the now widely-adopted A2 format seems like a gap that is worth filling.
Is your feature request related to a problem? Please describe.
The current model loading does not appear to handle deserializing
SlimmableContainerfrom JSON. This includes the standard A2 model format being shared by users and creators. I am currently experimenting with some ideas building on A2 models, and I would like to be able to load trained models back into a pytorch environment for evaluation, etc.Describe the solution you'd like
I would like
_from_nam.pyto handleSlimmableContaineras it does other serialized model types. I created PR #693 that extended the types there with the A2/PackedWaveNetcase, but @sdatkinson pointed out that the format is more flexible than that, i.e. is not bijective withPackedWaveNet. He suggested raising this issue instead.Assuming the
SlimmableContainerformat is sufficiently self-describing, it seems reasonable for the comprehensive solution to aim for a more general deserialization approach, proceeding piecewise through the config. IfSlimmableContainercould in principle contain furtherSlimmableContainer, recursion seems like a natural fit. Some adjustment of the interior parsing may be needed for the weights being placed other than at the top level.Describe alternatives you've considered
One workaround to handle the A2/
PackedWaveNetcase would be to deserialize that config only in an initial patch, throwing an exception for an incompatible config.Additional context
I am fairly easily able to workaround this issue by using code similar to #693 in my project. But not supporting round trips in the now widely-adopted A2 format seems like a gap that is worth filling.