You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try the run_scripts/blip2/pretrain_stage1.sh, an error happened in the dataloader:
AttributeError('Caught AttributeError in DataLoader worker process 0.\nOriginal Traceback (most recent call last):\n File "//.conda/envs/lavis/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop\n data = fetcher.fetch(index)\n File "//.conda/envs/lavis/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch\n return self.collate_fn(data)\n File "", line 2, in collater\n File "/***/.conda/envs/lavis/lib/python3.8/contextlib.py", line 111, in enter\n del self.args, self.kwds, self.func\nAttributeError: args\n')
After debugging, the problems comes from the class ConcatDataset in lavis/datasetes/datasets/base_dataset.
I've changed the line 13 to from torch.utils.data import Dataset, ConcatDataset as _ConcatDataset and line 74 to class ConcatDataset(_ConcatDataset):, and the problem goes away.
Here is the cause of the problem (what I believe, if not please correct me). The ConcatDataset should inherit from torch.dataset.ConcatDataset and it does not initialize correctly. Then, when the dataloader tries to get a batch of data, the dataloader did not find a getitems function under the ConcatDataset class (since it is not inherited correctly), thus raise the exception.
The text was updated successfully, but these errors were encountered:
When I try the run_scripts/blip2/pretrain_stage1.sh, an error happened in the dataloader:
After debugging, the problems comes from the class ConcatDataset in lavis/datasetes/datasets/base_dataset.
I've changed the line 13 to
from torch.utils.data import Dataset, ConcatDataset as _ConcatDataset
and line 74 toclass ConcatDataset(_ConcatDataset):
, and the problem goes away.Here is the cause of the problem (what I believe, if not please correct me). The ConcatDataset should inherit from torch.dataset.ConcatDataset and it does not initialize correctly. Then, when the dataloader tries to get a batch of data, the dataloader did not find a getitems function under the ConcatDataset class (since it is not inherited correctly), thus raise the exception.
The text was updated successfully, but these errors were encountered: