Getting this strange error during validation. Can’t find the same issue online. Are some of my batches being empty somehow?
Traceback (most recent call last):
  File "/home/tbhakta/anaconda3/envs/test/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/tbhakta/anaconda3/envs/test/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/tbhakta/internal-geometry/src/train.py", line 199, in <module>
    main(cfg)
  File "/home/tbhakta/internal-geometry/src/train.py", line 187, in main
    **cfg.training.fit,
  File "/home/tbhakta/internal-geometry/src/training/runner.py", line 314, in fit
    verbose=verbose,
  File "/home/tbhakta/anaconda3/envs/test/lib/python3.6/site-packages/torch/autograd/grad_mode.py", line 28, in decorate_context
    return func(*args, **kwargs)
  File "/home/tbhakta/internal-geometry/src/training/runner.py", line 343, in evaluate
    for i, batch in enumerate(dataloader):
  File "/home/tbhakta/anaconda3/envs/test/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 521, in __next__
    data = self._next_data()
  File "/home/tbhakta/anaconda3/envs/test/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1183, in _next_data
    return self._process_data(data)
  File "/home/tbhakta/anaconda3/envs/test/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
    data.reraise()
  File "/home/tbhakta/anaconda3/envs/test/lib/python3.6/site-packages/torch/_utils.py", line 425, in reraise
    raise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 12.
Original Traceback (most recent call last):
  File "/home/tbhakta/anaconda3/envs/test/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/tbhakta/anaconda3/envs/test/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch
    return self.collate_fn(data)
  File "/home/tbhakta/internal-geometry/src/train.py", line 39, in my_collate
    return torch.utils.data.dataloader.default_collate(batch)
  File "/home/tbhakta/anaconda3/envs/test/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 46, in default_collate
    elem = batch[0]
IndexError: list index out of range