ilnehc96 / HKU-DASC7606-A1

HKU DASC 7606 Assignment 1 (Computer Vision), 2023-24 Spring
18 stars 18 forks source link

FileNotFoundError: [Errno 2] No such file or directory: "./data\\'val'.json" #14

Closed hkcoserlamyiupong closed 7 months ago

hkcoserlamyiupong commented 7 months ago

image 螢幕擷取畫面 2024-03-01 031129 When I tried to the run (retinanet) C:\Users\user\Desktop\academics\DASC7606\HKU-DASC7606-A1>python test.py --coco_path ./data --checkpoint_path ./output/model_final.pt --depth 50 --set_name 'val' The following error appeared. I guess it is related to the string formatting of the file location. (There is actually a val.json inside the data directory.) What should I do?: loading annotations into memory... Traceback (most recent call last): File "test.py", line 68, in main() File "test.py", line 39, in main dataset_test = CocoDataset(parser.coco_path, set_name=parser.set_name, File "C:\Users\user\Desktop\academics\DASC7606\HKU-DASC7606-A1\retinanet\dataloader.py", line 37, in init self.coco = COCO(os.path.join(self.root_dir, self.set_name + '.json')) File "C:\ProgramData\Anaconda3\envs\retinanet\lib\site-packages\pycocotools\coco.py", line 81, in init with open(annotation_file, 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: "./data\'val'.json"

Alto-Clef commented 7 months ago

Try --set_name val instead of --set_name 'val'

python test.py --coco_path ./data --checkpoint_path ./output/model_final.pt --depth 50 --set_name val