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/
train2017/
val2017/
annotations/
instances_train2017.json
instances_val2017.json
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'
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'