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

batch_size=1 causes error when Squeeze() is in the "label" pipeline #13

Open
botcs opened this issue Jun 27, 2022 · 1 comment · May be fixed by #14
Open

batch_size=1 causes error when Squeeze() is in the "label" pipeline #13

botcs opened this issue Jun 27, 2022 · 1 comment · May be fixed by #14

Comments

@botcs
Copy link

botcs commented Jun 27, 2022

Exception in thread Thread-6:
Traceback (most recent call last):
  File "/home/cbotos/miniconda3/envs/ffcv/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/home/cbotos/miniconda3/envs/ffcv/lib/python3.9/site-packages/ffcv/loader/epoch_iterator.py", line 79, in run
    result = self.run_pipeline(b_ix, ixes, slot, events[slot])
  File "/home/cbotos/miniconda3/envs/ffcv/lib/python3.9/site-packages/ffcv/loader/epoch_iterator.py", line 138, in run_pipeline
    return tuple(x[:len(batch_indices)] for x in args)
  File "/home/cbotos/miniconda3/envs/ffcv/lib/python3.9/site-packages/ffcv/loader/epoch_iterator.py", line 138, in <genexpr>
    return tuple(x[:len(batch_indices)] for x in args)
IndexError: slice() cannot be applied to a 0-dim tensor.

I would say that this error is sorta unexpected, but I could have anticipated it since the Squeeze is also squishing the batch dimension in this case (if I understood the situation correctly)

@andrewilyas andrewilyas linked a pull request Jun 28, 2022 that will close this issue
@andrewilyas
Copy link
Contributor

Hi @botcs ! This should be fixed by #14 --- try using that branch and seeing if it fixes your issue? If it does we'll merge it in soon.

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

Successfully merging a pull request may close this issue.

2 participants