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

RuntimeError: stack expects each tensor to be equal size, but got [40, 240] at entry 0 and [78, 202] at entry 1 #98

Open
khainh3101 opened this issue Jun 15, 2021 · 0 comments

Comments

@khainh3101
Copy link

Hi, after preprocessing data and create alignments files by Tacotron2, I start training and get this error, can you resolve for me please ? In this case, i want to try to train an others language dataset. Thank you.
This's console error log:

Use FastSpeech
Model Has Been Defined
Number of TTS Parameters: 25367169
Load data to buffer
100%|██████████████████████████████████████████| 14139/14139 [00:06<00:00, 2245.24it/s]
cost 6.30s to load all data into buffer.
Defined Optimizer and Loss Function.
<class 'torch.Tensor'>
Traceback (most recent call last):
File "train.py", line 197, in
main(args)
File "train.py", line 83, in main
for i, batchs in enumerate(training_loader):
File "/mnt/9365f469-af3c-437f-9a58-546628b1869a/FastSpeech/fs-env/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 517, in next
data = self._next_data()
File "/mnt/9365f469-af3c-437f-9a58-546628b1869a/FastSpeech/fs-env/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 557, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/mnt/9365f469-af3c-437f-9a58-546628b1869a/FastSpeech/fs-env/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
return self.collate_fn(data)
File "/mnt/9365f469-af3c-437f-9a58-546628b1869a/FastSpeech/FastSpeech/dataset.py", line 118, in collate_fn_tensor
output.append(reprocess_tensor(batch, cut_list[i]))
File "/mnt/9365f469-af3c-437f-9a58-546628b1869a/FastSpeech/FastSpeech/dataset.py", line 93, in reprocess_tensor
durations = pad_1D_tensor(durations)
File "/mnt/9365f469-af3c-437f-9a58-546628b1869a/FastSpeech/FastSpeech/utils.py", line 75, in pad_1D_tensor
padded = torch.stack([pad_data(x, max_len, PAD) for x in inputs])
RuntimeError: stack expects each tensor to be equal size, but got [40, 240] at entry 0 and [78, 202] at entry 1

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