question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RuntimeError: The expanded size of the tensor (64) must match the existing size (112) at non-singleton dimension 2. Target sizes: [64, 80, 64]. Tensor sizes: [64, 1, 112]

See original GitHub issue

Hey,

I’m trying to run a training with Tacotron 1 using GST. I get the error on the first batch already.

Pytorch version: 1.8 and 1.7.1 (both yielded the same error) Python version: 3.8.0

Traceback (most recent call last): File "TTS/bin/train_tacotron.py", line 721, in <module> main(args) File "TTS/bin/train_tacotron.py", line 619, in main train_avg_loss_dict, global_step = train(train_loader, model, File "TTS/bin/train_tacotron.py", line 168, in train decoder_output, postnet_output, alignments, stop_tokens = model( File "/home/big-boy/anaconda3/envs/PyCapacitron/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/home/big-boy/projects/TTS/TTS/tts/models/tacotron.py", line 173, in forward decoder_outputs = decoder_outputs * output_mask.unsqueeze(1).expand_as(decoder_outputs) RuntimeError: The expanded size of the tensor (64) must match the existing size (112) at non-singleton dimension 2. Target sizes: [64, 80, 64]. Tensor sizes: [64, 1, 112]

My hyperparams: // TRAINING “batch_size”: 64, “eval_batch_size”: 16, “r”: 4, “gradual_training”: [ [0, 7, 64], [1, 5, 64], [50000, 3, 32], [130000, 2, 32], [290000, 1, 32] ], “mixed_precision”: true,

// MULTI-SPEAKER and GST “use_speaker_embedding”: false, // use speaker embedding to enable multi-speaker learning. “use_gst”: true, “use_external_speaker_embedding_file”: false, “external_speaker_embedding_file”: “…/…/speakers-vctk-en.json”, “gst”: { // gst parameter if gst is enabled “gst_style_input”: null, // Condition the style input either on a // -> wave file [path to wave] or // -> dictionary using the style tokens {‘token1’: ‘value’, ‘token2’: ‘value’} example {“0”: 0.15, “1”: 0.15, “5”: -0.15} // with the dictionary being len(dict) <= len(gst_style_tokens). “gst_embedding_dim”: 512, “gst_num_heads”: 4, “gst_style_tokens”: 10, “gst_use_speaker_embedding”: false },

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:28 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
a-froghyarcommented, Mar 11, 2021

Training is running, thank you guys so much!

I had to downgrade to librosa==0.6.3, though because of this:

librosa.util.exceptions.ParameterError: Audio buffer is not Fortran-contiguous. Use numpy.asfortranarray to ensure Fortran contiguity.

1reaction
WeberJuliancommented, Mar 11, 2021

did you pip install -e . again after the checkout ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

The expanded size of the tensor must match the existing size
I have a tensor with shape [2,3] and I want to expand it to [4,3]. If I use torch.expand directly, a error occurs....
Read more >
python - RuntimeError: The size of tensor a (133) must match ...
Well, the error is because the nn.MSELoss() and nn.CrossEntropyLoss() expect different input / target combinations. You cannot simply change ...
Read more >
Training languagemodel - RuntimeError the expanded size of ...
RuntimeError the expanded size of the tensor ( 100 ) must match the existing size ( 64 ) at non singleton dimension 1....
Read more >
How to fix: RuntimeError: The size of tensor a (2) must match ...
Im using PyTorch and I get the RuntimeError: The size of tensor a (2) must match the size of tensor b (3) at...
Read more >
The size of tensor a (3) must match the size of tensor b (7) at ...
But I got this error that I didn't find a good solution to: UserWarning: Using a target size (torch.Size([7])) that is different to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found