Open breazyG opened 4 years ago
How did you solve this issue ?
Hello, I have the same problem, have you already solved this issue?thx.
Hello, I have the same problem, have you already solved this issue?thx.
As I can see from the last line, your path is in incorrect format. Either change it to r'C:\Users\GuoJiaHao\coco\annotations\instances_train2014.json' or 'C:/Users/GuoJiaHao/coco/annotations/instances_train2014.json'
Same issue here!!!
Code:
import shapes if config.NAME == 'shapes': dataset = shapes.ShapesDataset() dataset.load_shapes(500, config.IMAGE_SHAPE[0], config.IMAGE_SHAPE[1]) elif config.NAME == "coco": dataset = coco.CocoDataset() dataset.load_coco(COCO_DIR, "train")
dataset.prepare()
print("Image Count: {}".format(len(dataset.image_ids))) print("Class Count: {}".format(dataset.num_classes)) for i, info in enumerate(dataset.class_info): print("{:3}. {:50}".format(i, info['name']))
error:
FileNotFoundError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_25932\798667116.py in 6 elif config.NAME == "coco": 7 dataset = coco.CocoDataset() ----> 8 dataset.load_coco(COCO_DIR, "train") 9 10 # Must call before using the dataset
c:\Users\chewk\Downloads\Mask_RCNN-master3\Mask_RCNN-master\samples\coco\coco.py in load_coco(self, dataset_dir, subset, year, class_ids, class_map, return_coco, auto_download) 109 self.auto_download(datasetdir, subset, year) 110 --> 111 coco = COCO("{}/annotations/instances{}{}.json".format(dataset_dir, subset, year)) 112 if subset == "minival" or subset == "valminusminival": 113 subset = "val"
c:\Users\chewk\anaconda3\lib\site-packages\pycocotools\coco.py in init(self, annotation_file) 79 print('loading annotations into memory...') 80 tic = time.time() ---> 81 with open(annotation_file, 'r') as f: 82 dataset = json.load(f) 83 assert type(dataset)==dict, 'annotation file format {} not supported'.format(type(dataset))
FileNotFoundError: [Errno 2] No such file or directory: 'path to COCO dataset/annotations/instances_train2014.json'
Does anyone solve this issue? Can show me where is the code that cause this error?
Traceback (most recent call last): File "D:/tf_gpu/Mask_RCNN-master/samples/coco/coco.py", line 481, in
dataset_train.load_coco(args.dataset, "train", year=args.year, auto_download=args.download)
File "D:/tf_gpu/Mask_RCNN-master/samples/coco/coco.py", line 111, in loadcoco
coco = COCO("{}/annotations/instances{}{}.json".format(dataset_dir, subset, year))
File "D:\anaconda1\envs\tensorflow2\lib\site-packages\pycocotools\coco.py", line 84, in init
with open(annotation_file, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\GuoJiaHao\coco/annotations/instances_train2014.json'
Just started to undertands this,how should I correct this error