lyuwenyu / RT-DETR

[CVPR 2024] Official RT-DETR (RTDETR paddle pytorch), Real-Time DEtection TRansformer, DETRs Beat YOLOs on Real-time Object Detection. 🔥 🔥 🔥
Apache License 2.0
2.61k stars 303 forks source link

"Keyword Error Alert" #239

Open Reaidu opened 7 months ago

Reaidu commented 7 months ago

命令:(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."

lyuwenyu commented 7 months ago

看着是数据不太对吧 请确保数据是正确的,比如在coco dataset里 打印一下量 看下是否符合预期

DaCheng1823 commented 6 months ago

权重文件是怎么调用的呀

ForgetMilkyway commented 1 month ago

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.

LANGZHIZHEN commented 1 month ago

thanks,it is useful to me. @ForgetMilkyway