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 decoding with small batch sizes #23

Open
prezaei85 opened this issue Oct 3, 2018 · 1 comment
Open

error in decoding with small batch sizes #23

prezaei85 opened this issue Oct 3, 2018 · 1 comment

Comments

@prezaei85
Copy link

prezaei85 commented Oct 3, 2018

I got the following error for batch size 5 and lower. I am trynig to use this for batch_size = 1 and I got the same thing. Any idea why?

python evaluate.py -model_path ../pretrained/pretrain.pt -batch_size 4
Evaluating model on the test set.
Loading model
Traceback (most recent call last):
  File "evaluate.py", line 89, in <module>
    main()
  File "evaluate.py", line 65, in main
    for batch in test_data:
  File "/home/ubuntu/anaconda3/envs/pytorch_p36_copy/lib/python3.6/site-packages/torchtext/data/iterator.py", line 151, in __iter__
    self.train)
  File "/home/ubuntu/anaconda3/envs/pytorch_p36_copy/lib/python3.6/site-packages/torchtext/data/batch.py", line 27, in __init__
    setattr(self, name, field.process(batch, device=device, train=train))
  File "/home/ubuntu/anaconda3/envs/pytorch_p36_copy/lib/python3.6/site-packages/torchtext/data/field.py", line 188, in process
    tensor = self.numericalize(padded, device=device, train=train)
  File "/home/ubuntu/anaconda3/envs/pytorch_p36_copy/lib/python3.6/site-packages/torchtext/data/field.py", line 310, in numericalize
    arr = self.tensor_type(arr)
RuntimeError: given sequence has an invalid size of dimension 2: 0


@rajasagashe
Copy link

There are some 0 len layouts
Add this to evaluate:

js_list = [js for js in js_list if len(js['lay']) > 0]

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