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

error "typeError: forward() got multiple values for argument 'return_unsample'" when running audiovisual training #14

Open
harsh-agarwal opened this issue Mar 14, 2021 · 1 comment

Comments

@harsh-agarwal
Copy link

I am getting the following error log when I try running the training for audiovisual synthesis after training my audio branch.

---  ./oliver_train/ already exists!  ---
--- Totally 18227 video frames ---
Encoding Audio of  ./oliver_train.mp4
/extern/home/harshagarwal/miniconda3/envs/av2/lib/python3.7/site-packages/librosa/core/audio.py:146: UserWarning: PySoundFile failed. Trying audioread instead.
  warnings.warn('PySoundFile failed. Trying audioread instead.')
Raw_Data Shape: (80, 72901)
---  logs/oliver_video already exists!  ---
---  ./saved_models/oliver_video already exists!  ---
Trainable Parameters: 4.481M
Loading from ./pretrained_models/oliver.pkl...
Load 254 parameters!
AutoVC Model Loaded
Traceback (most recent call last):
  File "train_audiovisual.py", line 77, in <module>
    G.optimize_parameters_video(dataloader, args.epochs, device, display_freq=args.display_freq, save_freq=args.save_freq, save_dir=save_dir, experimentName=experimentName, initial_niter=args.initial_iter, load_model=args.load_model)
  File "/extern/home/harshagarwal/Audiovisual-Synthesis/model_vc.py", line 631, in optimize_parameters_video
    codes, code_unsample = self.encoder(mel, speaker, return_unsample=True)
  File "/extern/home/harshagarwal/miniconda3/envs/av2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
TypeError: forward() got multiple values for argument 'return_unsample' 

Any help is appreciated!

@harsh-agarwal
Copy link
Author

https://github.com/dunbar12138/Audiovisual-Synthesis/blob/master/model_vc.py#L631

codes, code_unsample = self.encoder(mel, speaker, return_unsample=True)

This removes the speaker embedding argument from all the self.encoder function calls. Apparently the encoder definition state it is def without speaker embedding as of now.

The other lines that would need a change are:

Line 647, 706, 708

@dunbar12138 if this is the expected solution please close the issue. If there is a better solution please let me know :)

Thanks!

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

1 participant