Skip to content
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

TypeError: FAquantizer.forward_v2() got multiple values for argument 'n_c' when training redecoder. #28

Open
rgxb2807 opened this issue Nov 27, 2024 · 1 comment

Comments

@rgxb2807
Copy link

rgxb2807 commented Nov 27, 2024

Hi, hitting the following error when trying to train the redecoder using the example configs. It appears to originate from using timbre_norm=True in the FAQuantizer contructor which then calls the forward_v2 function.

The problem arises because it appears that train_redecoder.py still expects the first v1 forward function

If I comment out this code and switch back to the original forward function, I get a different error TypeError: FAquantizer.forward() got an unexpected keyword argument 'full_waves'

[rank0]:   File "/audio/models/FAcodec/train_redecoder.py", line 456, in <module>
[rank0]:     main(args)
[rank0]:   File "/audio/models/FAcodec/train_redecoder.py", line 220, in main
[rank0]:     z, quantized, commitment_loss, codebook_loss, timbre, codes = codec_encoder.quantiz
er(z, wav_seg,
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1553,
 in _wrapped_call_impl
[rank0]:     return self._call_impl(*args, **kwargs)
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1562,
 in _call_impl
[rank0]:     return forward_call(*args, **kwargs)
[rank0]: TypeError: FAquantizer.forward_v2() got multiple values for argument 'n_c'

after after commenting out forward_v2

[rank0]: Traceback (most recent call last):                                                     
[rank0]:   File "/audio/models/FAcodec/train_redecoder.py", line 456, in <module>               
[rank0]:     main(args)                                                                         
[rank0]:   File "/audio/models/FAcodec/train_redecoder.py", line 220, in main                   
[rank0]:     z, quantized, commitment_loss, codebook_loss, timbre, codes = codec_encoder.quantiz
er(z, wav_seg,                                                                                  
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1553,
 in _wrapped_call_impl                                                                          
[rank0]:     return self._call_impl(*args, **kwargs)                                            
[rank0]:   File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1562,
 in _call_impl                                                                                  
[rank0]:     return forward_call(*args, **kwargs)                                               
[rank0]: TypeError: FAquantizer.forward() got an unexpected keyword argument 'full_waves'
@Plachtaa
Copy link
Owner

Hi there, thanks for your kind feedback!
I will take a look at the code soon and fix the problem ASAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants