You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that when setting max tokens < 128 in the dummy step before starting the actual training an error occurs.
| training on 1 GPUs
| max tokens per GPU = 25 and max sentences per GPU = None
Traceback (most recent call last):
File "train.py", line 358, in <module>
main(args)
File "train.py", line 78, in main
trainer.dummy_train_step([dummy_batch])
File "/home/roberto.dessi/new_fairseq/fairseq/trainer.py", line 326, in dummy_train_step
self.train_step(dummy_batch, dummy_batch=True)
File "/home/roberto.dessi/new_fairseq/fairseq/trainer.py", line 176, in train_step
ignore_grad
File "/home/roberto.dessi/new_fairseq/fairseq/tasks/fairseq_task.py", line 169, in train_step
loss, sample_size, logging_output = criterion(model, sample)
File "/home/roberto.dessi/.virtualenvs/work/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
result = self.forward(*input, **kwargs)
File "/home/roberto.dessi/new_fairseq/fairseq/criterions/cross_entropy.py", line 30, in forward
net_output = model(**sample['net_input'])
TypeError: 'NoneType' object is not subscriptable
I noticed that when setting max tokens < 128 in the dummy step before starting the actual training an error occurs.
The error is caused by https://github.com/robertodessi/fairseq/blob/master/fairseq/data/language_pair_dataset.py#L195
It seems to me that a small value of max_tokens causes that division to be 0 and to create an empty dummy batch that raise the above error.
It works when I replace that line with:
The text was updated successfully, but these errors were encountered: