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 in seq2seq.py of Method collate #44

Open
lypenghao opened this issue Feb 18, 2019 · 3 comments
Open

Error in seq2seq.py of Method collate #44

lypenghao opened this issue Feb 18, 2019 · 3 comments

Comments

@lypenghao
Copy link

/home/wangph/code/pytorch_egs/speech/speech/models/seq2seq.py:235: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
inputs.volatile = True
/home/wangph/code/pytorch_egs/speech/speech/models/seq2seq.py:236: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
labels.volatile = True

Traceback (most recent call last):
File "train.py", line 146, in
run(config)
File "train.py", line 109, in run
dev_loss, dev_cer = eval_dev(model, dev_ldr, preproc)
File "train.py", line 58, in eval_dev
loss = model.loss(batch)
File "/home/wangph/code/pytorch_egs/speech/speech/models/seq2seq.py", line 53, in loss
x, y = self.collate(*batch)
TypeError: collate() missing 2 required positional arguments: 'inputs' and 'labels'

@dmitrii-obukhov
Copy link

Probably, this is because batch is zip object, and you can iterate over batch only once. Adding 'batch = list(batch)' at eval_dev() in the for loop helps me.

@ghost
Copy link

ghost commented Jun 26, 2019

I'm currently facing the same issue, I added batch = list(batch) and manually replaced collate with collate(batch[0], batch[1]) and the issue becomes index 1 out of range.

@iamxiaoyubei
Copy link

+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

3 participants