IDEA-Research / DINO

[ICLR 2023] Official implementation of the paper "DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection"
Apache License 2.0
2.08k stars 228 forks source link

"No such file or directory" when training on custom dataset #221

Open eirikmn opened 10 months ago

eirikmn commented 10 months ago

I tried training the 4-scale model using bash scripts/DINO_train.sh /path/to/dataset on my custom dataset which has 4 classes. I have updated the config file accordingly and restructured the data folder to the COCO style as instructed: COCODIR/

However, right after the output text reads "Start training" I receive multiple errors. The traceback states FileNotFoundError: [Errno 2] No such file or directory: 'mydata/foramcoco/train2017/S-4-3-1_JPG_jpg.rf.c84ecde4aaae068c77473036859e07f0.jpg'. However, I've verified that the file in question is definitely included in the correct folders. Do you have any suggestions on how to resolve this issue?

I am working on Ubuntu 20.04 through WSL (Win11). The full error reads: Traceback (most recent call last): File "/home/USER/anaconda3/envs/dino/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop data = fetcher.fetch(index) File "/home/USER/anaconda3/envs/dino/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/USER/anaconda3/envs/dino/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/USER/dino/DINO/datasets/coco.py", line 356, in __getitem__ img, target = super(CocoDetection, self).__getitem__(idx) File "/home/USER/anaconda3/envs/dino/lib/python3.7/site-packages/torchvision/datasets/coco.py", line 48, in __getitem__ image = self._load_image(id) File "/home/USER/anaconda3/envs/dino/lib/python3.7/site-packages/torchvision/datasets/coco.py", line 41, in _load_image return Image.open(os.path.join(self.root, path)).convert("RGB") File "/home/USER/anaconda3/envs/dino/lib/python3.7/site-packages/PIL/Image.py", line 3236, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'mydata/foramcoco/train2017/S-4-3-1_JPG_jpg.rf.c84ecde4aaae068c77473036859e07f0.jpg'

MarkLai0317 commented 9 months ago

you need to use absolute path of your data directory