cocodataset / cocoapi

COCO API - Dataset @ http://cocodataset.org/
Other
6.05k stars 3.75k forks source link

"name 'COCO' is not defined" in Mask RCNN code #353

Open VahidChahkandi opened 4 years ago

VahidChahkandi commented 4 years ago

Hi everyone, I'm working on MASK RCNN repository and I ran demo.ipynb file but when I want to run the other notbook files from this repository such as "inspect_model.ipynb" or "inspect_data.ipynb" I face to this error in "Loading Dataset" part: **NameError Traceback (most recent call last)

in () 4 elif config.NAME == "coco": 5 dataset = coco.CocoDataset() ----> 6 dataset.load_coco(COCO_DIR, "train") 7 8 # Must call before using the dataset /content/gdrive/My Drive/Colab Notebooks/MASK RCNN/samples/coco/coco.py in load_coco(self, dataset_dir, subset, year, class_ids, class_map, return_coco, auto_download) 109 self.auto_download(dataset_dir, subset, year) 110 --> 111 coco = COCO("{}/annotations/instances_{}{}.json".format(dataset_dir, subset, year)) 112 if subset == "minival" or subset == "valminusminival": 113 subset = "val" NameError: name 'COCO' is not defined** For information, I'm running this code on Google COLAB. I would be appreciated for any help.
Benito2204 commented 4 years ago

Hi VahidChahkandi,

Even I am working on this repo. I got stuck in demo.py

Can you send me your demo.py file?

Thanks