Mask_rcnn: Load Validation Dataset there is a mistake and how to solve it

Created on 29 Mar 2018  路  4Comments  路  Source: matterport/Mask_RCNN

loading annotations into memory...

FileNotFoundError Traceback (most recent call last)
in ()
5 elif config.NAME == "coco":
6 dataset = coco.CocoDataset()
----> 7 dataset.load_coco(COCO_DIR, "minival")
8
9 # Must call before using the dataset

~/Downloads/mrcnn_test/coco.py in load_coco(self, dataset_dir, subset, year, class_ids, class_map, return_coco, auto_download)
106 self.auto_download(dataset_dir, subset, year)
107
--> 108 coco = COCO("{}/annotations/instances_{}{}.json".format(dataset_dir, subset, year))
109 if subset == "minival" or subset == "valminusminival":
110 subset = "val"

~/Downloads/mrcnn_test/pycocotools/coco.py in __init__(self, annotation_file)
77 print('loading annotations into memory...')
78 tic = time.time()
---> 79 dataset = json.load(open(annotation_file, 'r'))
80 assert type(dataset)==dict, 'annotation file format {} not supported'.format(type(dataset))
81 print('Done (t={:0.2f}s)'.format(time.time()- tic))

FileNotFoundError: [Errno 2] No such file or directory: '~/Downloads/mrcnn_test/coco/annotations/instances_minival2014.json'
# I just begin to test it,so can you help me to solve this problem?

Most helpful comment

Try to use the absolute path and you will have no error if the file exist in the annotations folder.

All 4 comments

@chrispolo the script cannot find the json file called instances_minival2014.json.
Please check the path. If you don't have the file, you have to download it and place it in the right folder.

@fastlater Thank you,fastlater! I had download the instances_minival2014.json and instances_valminusminival2014.json , i add the path to the inspect_model.ipynb like this

MS COCO Dataset

import coco config = coco.CocoConfig() COCO_DIR = "/home/Downloads/mrcnn_test/coco"
the coco is the folder,but when i run it in the jupyter notebook, there is still a mistake.
The mistake ie like this `FileNotFoundError Traceback (most recent call last)
in ()
5 elif config.NAME == "coco":
6 dataset = coco.CocoDataset()
----> 7 dataset.load_coco(COCO_DIR, "minival")
8
9 # Must call before using the dataset

~/Downloads/mrcnn_test/coco.py in load_coco(self, dataset_dir, subset, year, class_ids, class_map, return_coco, auto_download)
106 self.auto_download(dataset_dir, subset, year)
107
--> 108 coco = COCO("{}/annotations/instances_{}{}.json".format(dataset_dir, subset, year))
109 if subset == "minival" or subset == "valminusminival":
110 subset = "val"

~/Downloads/mrcnn_test/pycocotools/coco.py in __init__(self, annotation_file)
77 print('loading annotations into memory...')
78 tic = time.time()
---> 79 dataset = json.load(open(annotation_file, 'r'))
80 assert type(dataset)==dict, 'annotation file format {} not supported'.format(type(dataset))
81 print('Done (t={:0.2f}s)'.format(time.time()- tic))

FileNotFoundError: [Errno 2] No such file or directory: '/home/Downloads/mrcnn_test/coco/annotations/instances_minival2014.json'`
Would you help solve this ? Thank you very much.

Try to use the absolute path and you will have no error if the file exist in the annotations folder.

@fastlater i got it ,thx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wjdhuster2018 picture wjdhuster2018  路  3Comments

PaulChongPeng picture PaulChongPeng  路  4Comments

jameschartouni picture jameschartouni  路  4Comments

ziyigogogo picture ziyigogogo  路  3Comments

techjjun picture techjjun  路  4Comments