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

Zero-sized dimensions while batchifying #3

Open
aayux opened this issue Sep 4, 2018 · 1 comment
Open

Zero-sized dimensions while batchifying #3

aayux opened this issue Sep 4, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@aayux
Copy link
Owner

aayux commented Sep 4, 2018

Traceback (most recent call last):
  File "finetune.py", line 69, in <module>
    main()
  File "finetune.py", line 21, in main
    loader = ff.Loader(train, val, lang='en', bs=64, bptt=60)
  File "/home/guest/user/fitfast/trainer.py", line 70, in __init__
    self.val = LanguageModelIterator(val_ids, bs, bptt)
  File "/home/guest/user/fitfast/text.py", line 19, in __init__
    self.data = self.batchify(data)
  File "/home/guest/user/fitfast/text.py", line 45, in batchify
    return T(data)
  File "/home/guest/user/fitfast/utils/core.py", line 28, in T
    a = torch.LongTensor(a.astype(np.int64))
RuntimeError: the given numpy array has zero-sized dimensions. Zero-sized dimensions are not supported in PyTorch
@aayux aayux added the bug Something isn't working label Sep 4, 2018
@aayux
Copy link
Owner Author

aayux commented Sep 4, 2018

This occurs on small datasets where batch size is larger than the data length. A related issue is when the large batch size causes __len__() for LanguageModelIterator objects to return -1 (why?).

TO DO: Catch and handle these conditions.

@aayux aayux added this to In progress in Goal Descriptions Sep 5, 2018
@aayux aayux moved this from In progress to To do in Goal Descriptions Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant