-
Notifications
You must be signed in to change notification settings - Fork 395
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
__init__() got an unexpected keyword argument 'max_iter' #166
Comments
I have solved this problem : |
same, TypeError: init() got an unexpected keyword argument 'max_iter' |
@Cryptospy It is due to the stable version of torchaudio has been updated to 2.1.2, InverseMelScale class in torchaudio 2.0.1 has the keyword argument named 'max_iter' You can solve the problem easily with the solution that @wangjifly1 suggested for us. if you would be available for a second for me, Hope you have a peaceful day and happy new year✨ |
@J4BEZ This worked for me: pip uninstall torch torchaudio torchvision pip install torch==2.0.1+cu118 torchaudio==2.0.2+cu118 torchvision==0.15.2+cu118 -f https://download.pytorch.org/whl/cu118/torch_stable.html |
@J4BEZ happy new year to you too mate |
@Cryptospy Happy to hear that😆😆 |
If downgrading torchaudio is not an option, the following code modification works for me (removal of unused parameters due to API changes in torchaudio 2.1.x): diff --git a/riffusion/spectrogram_converter.py b/riffusion/spectrogram_converter.py
index 9fbfc65..2beb605 100644
--- a/riffusion/spectrogram_converter.py
+++ b/riffusion/spectrogram_converter.py
@@ -90,10 +90,6 @@ class SpectrogramConverter:
sample_rate=params.sample_rate,
f_min=params.min_frequency,
f_max=params.max_frequency,
- max_iter=params.max_mel_iters,
- tolerance_loss=1e-5,
- tolerance_change=1e-8,
- sgdargs=None,
norm=params.mel_scale_norm,
mel_scale=params.mel_scale_type,
).to(self.device) |
when i run a test as follows:
python -m unittest test.audio_to_image_test
an error happens:
Traceback (most recent call last):
File "/Users/wangji/riffusion-main/test/audio_to_image_test.py", line 42, in test_stereo
self.helper_test_with_params(params)
File "/Users/wangji/riffusion-main/test/audio_to_image_test.py", line 60, in helper_test_with_params
audio_to_image(audio=str(audio_path), image=str(image_path), **params)
File "/Users/wangji/riffusion-main/riffusion/cli.py", line 54, in audio_to_image
converter = SpectrogramImageConverter(params=params, device=device)
File "/Users/wangji/riffusion-main/riffusion/spectrogram_image_converter.py", line 21, in init
self.converter = SpectrogramConverter(params=params, device=device)
File "/Users/wangji/riffusion-main/riffusion/spectrogram_converter.py", line 87, in init
self.inverse_mel_scaler = torchaudio.transforms.InverseMelScale(
TypeError: init() got an unexpected keyword argument 'max_iter'
Many thanks for help!!
The text was updated successfully, but these errors were encountered: