matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.69k stars 11.71k forks source link

Load Validation Dataset there is a mistake and how to solve it #374

Open chrispolo opened 6 years ago

chrispolo commented 6 years ago

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?**
fastlater commented 6 years ago

@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.

chrispolo commented 6 years ago

@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.
fastlater commented 6 years ago

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

chrispolo commented 6 years ago

@fastlater i got it ,thx