Open Reaidu opened 7 months ago
看着是数据不太对吧 请确保数据是正确的,比如在coco dataset里 打印一下量 看下是否符合预期
权重文件是怎么调用的呀
I encountered the same issue, and I resolved it by setting remap_mscoco_category to False in the rtdetr_pytorch/configs/rtdetr/rtdetr_r18vd_6x_coco.yml file.
thanks,it is useful to me. @ForgetMilkyway
命令:(rtdetr) root@autodl-container-d8bc11a952-991f7f93:~/RT-DETR-main/rtdetr_pytorch# python tools/train.py -c configs/rtdetr/rtdetr_r18vd_6x_coco.yml Not init distributed mode. Start training Load PResNet18 state_dict Initial lr: [1e-05, 1e-05, 0.0001, 0.0001] loading annotations into memory... Done (t=0.19s) creating index... index created! loading annotations into memory... Done (t=0.00s) creating index... index created! number of params: 20089448 Traceback (most recent call last): File "tools/train.py", line 48, in
main(args)
File "tools/train.py", line 34, in main
solver.fit()
File "/root/RT-DETR-main/rtdetr_pytorch/tools/../src/solver/det_solver.py", line 37, in fit
train_stats = train_one_epoch(
File "/root/RT-DETR-main/rtdetr_pytorch/tools/../src/solver/det_engine.py", line 35, in train_one_epoch
for samples, targets in metric_logger.log_every(data_loader, print_freq, header):
File "/root/RT-DETR-main/rtdetr_pytorch/tools/../src/misc/logger.py", line 215, in log_every
for obj in iterable:
File "/root/miniconda3/envs/rtdetr/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 633, in next
data = self._next_data()
File "/root/miniconda3/envs/rtdetr/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1345, in _next_data
return self._process_data(data)
File "/root/miniconda3/envs/rtdetr/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data
data.reraise()
File "/root/miniconda3/envs/rtdetr/lib/python3.8/site-packages/torch/_utils.py", line 644, in reraise
raise exception
KeyError: Caught KeyError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/root/miniconda3/envs/rtdetr/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/root/miniconda3/envs/rtdetr/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/root/miniconda3/envs/rtdetr/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/root/RT-DETR-main/rtdetr_pytorch/tools/../src/data/coco/coco_dataset.py", line 38, in getitem
img, target = super(CocoDetection, self).getitem(idx)
File "/root/miniconda3/envs/rtdetr/lib/python3.8/site-packages/torchvision/datasets/coco.py", line 48, in getitem
image = self._load_image(id)
File "/root/miniconda3/envs/rtdetr/lib/python3.8/site-packages/torchvision/datasets/coco.py", line 40, in _load_image
path = self.coco.loadImgs(id)[0]["file_name"]
File "/root/miniconda3/envs/rtdetr/lib/python3.8/site-packages/pycocotools/coco.py", line 227, in loadImgs
return [self.imgs[id] for id in ids]
File "/root/miniconda3/envs/rtdetr/lib/python3.8/site-packages/pycocotools/coco.py", line 227, in
return [self.imgs[id] for id in ids]
KeyError: '1'
"Congratulations on your paper being accepted by CVPR! Can you please tell me how to solve it? Thank you."