Open baldman12 opened 1 year ago
你要不看看是不是漏了其中哪个数据集,看看这个names是不是空的~
|-- data |-- GenMOP |-- chair ... |-- LINEMOD |-- cat ... |-- shapenet |-- shapenet_cache |-- shapenet_render |-- shapenet_render_v1.pkl |-- co3d_256_512 |-- apple ... |-- google_scanned_objects |-- 06K3jXvzqIM ... |-- coco |-- train2017 我是这样布置的,是否还需要其他数据集。并且这个报错是训练中途报错,有时是第3次有时是第15次
Hello @baldman12, I had the same problem while I was training the detector and I solved this issue by modifying the value use_database_sample_prob in the config file from true to false. @liuyuan-pal can you explain the use of this value? Thank you!
在训练detector和selector时会报错以下是详细信息: File "/media/dj/F054ABE054ABA7B4/code/py/6D/Gen6D-main/train_model.py", line 11, in
trainer.run()
File "/media/dj/F054ABE054ABA7B4/code/py/6D/Gen6D-main/train/trainer.py", line 111, in run
train_data = next(train_iter)
File "/home/dj/conda/envs/pyotrch/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 628, in next
data = self._next_data()
File "/home/dj/conda/envs/pyotrch/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1313, in _next_data
return self._process_data(data)
File "/home/dj/conda/envs/pyotrch/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1359, in _process_data
data.reraise()
File "/home/dj/conda/envs/pyotrch/lib/python3.9/site-packages/torch/_utils.py", line 543, in reraise
raise exception
ValueError: Caught ValueError in DataLoader worker process 4.
Original Traceback (most recent call last):
File "/home/dj/conda/envs/pyotrch/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
data = fetcher.fetch(index)
File "/home/dj/conda/envs/pyotrch/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/dj/conda/envs/pyotrch/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 58, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/media/dj/F054ABE054ABA7B4/code/py/6D/Gen6D-main/dataset/train_dataset.py", line 992, in getitem
database, que_ids = self._select_query(index)
File "/media/dj/F054ABE054ABA7B4/code/py/6D/Gen6D-main/dataset/train_dataset.py", line 247, in _select_query
database = self.name2database[np.random.choice(names)]
File "mtrand.pyx", line 915, in numpy.random.mtrand.RandomState.choice
ValueError: 'a' cannot be empty unless no samples are taken
好像是集合为空的问题,请问应该如何解决。谢谢