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 for training ycbv - list indices must be integers or slices not dict. #79

Open
HannahHaensen opened this issue Jun 22, 2022 · 0 comments

Comments

@HannahHaensen
Copy link

HannahHaensen commented Jun 22, 2022

When training on ycbv we have the error that ist indices must be integers or slices not dict, this is weird as at the beginning for a few iterations it seems fine.

Anyone else met this error? recommendations or explanation why this happend

epochs:   0%|                                                                                                                                                                                                                                                                                                                                                                                         | 0/25 [05:19<?, ?it/s]
Traceback (most recent call last):                                                                                                                                                                                                                                                                                                                                                                                           
  File "train_ycb.py", line 668, in <module>
    train()
  File "train_ycb.py", line 655, in train
    trainer.train(
  File "train_ycb.py", line 493, in train
    val_loss, res = self.eval_epoch(test_loader, it=it)
  File "train_ycb.py", line 347, in eval_epoch
    for i, data in tqdm.tqdm(
  File "/home/user/Documents/GitHub/FFB6D/venv/lib/python3.8/site-packages/tqdm/std.py", line 1195, in __iter__
    for obj in iterable:
  File "/home/user/Documents/GitHub/FFB6D/venv/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 517, in __next__
    data = self._next_data()
  File "/home/user/Documents/GitHub/FFB6D/venv/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1199, in _next_data
    return self._process_data(data)
  File "/home/user/Documents/GitHub/FFB6D/venv/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1225, in _process_data
    data.reraise()
  File "/home/user/Documents/GitHub/FFB6D/venv/lib/python3.8/site-packages/torch/_utils.py", line 429, in reraise
    raise self.exc_type(msg)
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/user/Documents/GitHub/FFB6D/venv/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/user/Documents/GitHub/FFB6D/venv/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/user/Documents/GitHub/FFB6D/venv/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/user/Documents/GitHub/FFB6D/ffb6d/datasets/ycb/ycb_dataset.py", line 401, in __getitem__
    item_name = self.all_lst[idx]
TypeError: list indices must be integers or slices, not dict

error happens in 'else' of ycb_dataset

    def __getitem__(self, idx):
        if self.dataset_name == 'train':
            item_name = self.real_syn_gen()
            data = self.get_item(item_name)
            while data is None:
                item_name = self.real_syn_gen()
                data = self.get_item(item_name)
            return data
        else:
            # print(idx, self.all_lst)
            item_name = self.all_lst[idx]
            return self.get_item(item_name)

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

1 participant