csteinmetz1 / auraloss

Collection of audio-focused loss functions in PyTorch
Apache License 2.0
717 stars 66 forks source link

MultiResolutionSTFTLoss doesn't accept device? #20

Closed turian closed 3 years ago

turian commented 3 years ago

I assumed that since it took kwargs, I could pass in device.

However, I get this error:

TypeError: __init__() got an unexpected keyword argument 'device'
csteinmetz1 commented 3 years ago

Can you confirm which version you are using? This works for me on v0.2.0.

That being said, while checking, I discovered a bug with the case when you pass a device and are not using the Mel filterbank. I am working on a fix for that now.

turian commented 3 years ago

0.2.0

turian commented 3 years ago

I was calling it like this:

        self.loss = auraloss.freq.MultiResolutionSTFTLoss(
            fft_sizes=[4096, 2048, 1024, 512, 256, 128, 64],
            hop_sizes=[480, 240, 120, 60, 30, 15, 8],
            win_lengths=[2400, 1200, 600, 300, 150, 75, 37],
            device=self.device
        )
csteinmetz1 commented 3 years ago

I was not able to reproduce your exact error, but I have now made a fix for the related issue I mentioned before. There is now a new release (#21) v0.2.1 pushed to pypi. I don't receive any error calling as you did above. Let me know if this solves your issue.

turian commented 3 years ago

Thanks. I'll close the issue for now and re-open if I have more details.