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

ValueError: need at least one array to stack train_tacotron.py line 192 #70

Open
Xlikes opened this issue Feb 19, 2022 · 1 comment
Open

Comments

@Xlikes
Copy link

Xlikes commented Feb 19, 2022

ValueError: need at least one array to stack

Traceback (most recent call last):
File "C:\Users\Pc\Downloads\ForwardTacotron-master\train_tacotron.py", line 192, in
trainer.train(model, optimizer)
File "C:\Users\Pc\Downloads\ForwardTacotron-master\trainer\taco_trainer.py", line 49, in train
self.train_session(model, optimizer, session=session)
File "C:\Users\Pc\Downloads\ForwardTacotron-master\trainer\taco_trainer.py", line 70, in train_session
for i, batch in enumerate(session.train_set, 1):
File "C:\Python39\lib\site-packages\torch\utils\data\dataloader.py", line 521, in next
data = self._next_data()
File "C:\Python39\lib\site-packages\torch\utils\data\dataloader.py", line 560, in _next_data
index = self._next_index() # may raise StopIteration
File "C:\Python39\lib\site-packages\torch\utils\data\dataloader.py", line 512, in _next_index
return next(self._sampler_iter) # may raise StopIteration
File "C:\Python39\lib\site-packages\torch\utils\data\sampler.py", line 229, in iter
for idx in self.sampler:
File "C:\Users\Pc\Downloads\ForwardTacotron-master\utils\dataset.py", line 337, in iter
binned_idx = np.stack(bins).reshape(-1)
File "<array_function internals>", line 5, in stack
File "C:\Python39\lib\site-packages\numpy\core\shape_base.py", line 423, in stack
raise ValueError('need at least one array to stack')
ValueError: need at least one array to stack

I have a problem with python train_tacotron.py
I have set the Num Validation down to 20. Can this be the cause of the problem?
(This setting must be so low because of the 21 files. I am aware of the poor quality.)

Windows 10
cuda 11.3.0
torch 1.10.2

@danjeffree
Copy link

danjeffree commented Jul 16, 2023

Bit late but leaving here in case anyone if the future needs a fix.

Go to line 40 in trainer/taco_trainer.py

create a line under r, lr, max_step, bs = session_params
add bs = 2 or whatever number you need.

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