torch-stft icon indicating copy to clipboard operation
torch-stft copied to clipboard

Export to onnx

Open bzp83 opened this issue 1 year ago • 0 comments

Hi!

Thanks for this work!

I'm using this in a model and when I try to export the model to onnx, I get: Missing key(s) in state_dict: "model_g.dec.stft.forward_basis", "model_g.dec.stft.inverse_basis".

If I change the lines below to persistent=False, the export works... But I'm not sure if this will have any effect that I can't foresee as this persistent flag is not clear to me.

Would you please tell me if this is acceptable?

Thank you!

https://github.com/pseeth/torch-stft/blob/193ad6a20422ba57787c4dc2364c30f07cf3f46e/torch_stft/stft.py#L53 and https://github.com/pseeth/torch-stft/blob/193ad6a20422ba57787c4dc2364c30f07cf3f46e/torch_stft/stft.py#L54 to:

        self.register_buffer('forward_basis', forward_basis.float(), persistent=False)
        self.register_buffer('inverse_basis', inverse_basis.float(), persistent=False)

bzp83 avatar Jun 15 '24 13:06 bzp83