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 when increasing batch_size #95

Open
vasyarv opened this issue Aug 2, 2021 · 2 comments
Open

Error when increasing batch_size #95

vasyarv opened this issue Aug 2, 2021 · 2 comments

Comments

@vasyarv
Copy link

vasyarv commented Aug 2, 2021

When I try to increase batch_size to any number (4, 32, ... ) I get strange error:

python main.py --num_iters 100000 --batch_size 4
Namespace(batch_size=4, data_dir='./spmel', dim_emb=256, dim_neck=16, dim_pre=512, freq=16, lambda_cd=1, len_crop=128, log_step=10, num_iters=100000)
Finished loading the dataset...
cuda:0
Start training...
Traceback (most recent call last):
  File "solver_encoder.py", line 75, in train
    x_real, emb_org = next(data_iter)
UnboundLocalError: local variable 'data_iter' referenced before assignment

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 46, in <module>
    main(config)
  File "main.py", line 20, in main
    solver.train()
  File "autovc/solver_encoder.py", line 78, in train
    x_real, emb_org = next(data_iter)
  File "python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in __next__
    data = self._next_data()
  File "python3.8/site-packages/torch/utils/data/dataloader.py", line 560, in _next_data
    index = self._next_index()  # may raise StopIteration
  File "python3.8/site-packages/torch/utils/data/dataloader.py", line 512, in _next_index
    return next(self._sampler_iter)  # may raise StopIteration
StopIteration

Is this bug?

@MarcoVitella
Copy link

I've got the same error, have you find out how to solve it?

@auspicious3000
Copy link
Owner

batch size cannot be larger than the data size

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

3 participants