audio
audio copied to clipboard
Use non-persistent buffers
🚀 The feature
Suggest using register_buffer()
with persistent=False
, so the buffer (e.g. window of spectrogram) will not be included in module's state dict.
Motivation, pitch
When I add new transforms to my model and load a pre-existing checkpoint, a missing key
error will be raised, e.g. missing resample kernel in transforms.Resample
. It can be solved by specifying strict=False
at load time, however, I don't see any reason to save the buffers. They can be recomputed on construction time and that won't affect model's behavior.
Alternatives
No response
Additional context
Same motivation as https://github.com/pytorch/pytorch/issues/18056.
This sounds reasonable to me. @pytorch/team-audio-core any objection?
The team thinks this is a good change, and we look for contributor to make the change. Feel free to open a PR.
Hello,
Is anyone working on this? I'm planning to give it a shot and possibly submit a PR.
HIi @ashikshafi08
Thanks for the interest. No one is working on it, so feel free to do so.
@mthrok I don’t see recent updates on this issue. I can take a look at this issue if there are no conflicts with others?
@mthrok I don’t see recent updates on this issue. I can take a look at this issue if there are no conflicts with others?
@francislata Thanks for the suggestion. I don't think anyone is working on it, so feel free to send a PR.