Closed HOD101s closed 4 years ago
If you need help to solve an unexpected issue you observed, please include details following the "Unexpected behaviors" issue template.
If you need help to solve an unexpected issue you observed, please include details following the "Unexpected behaviors" issue template.
Followed the same. Just Renamed the issue. Any Help would be great!
Please provide full logs following the issue template
Please provide full logs following the issue template
Updated issue with logs
By "full logs" I'm expecting to see logs from the beginning of the program, not just the error.
Anyway, can you try again after removing the generated json file?
On deleting the file and running again it gives file not found error
FileNotFoundError Traceback (most recent call last)
<ipython-input-16-10943452416d> in <module>()
----> 1 evaluator = COCOEvaluator("lplates_test", cfg, False, output_dir="./output2/")
2 val_loader = build_detection_test_loader(cfg, "lplates_test")
3 print(inference_on_dataset(trainer.model, val_loader, evaluator))
1 frames
/usr/local/lib/python3.6/dist-packages/detectron2/evaluation/coco_evaluation.py in __init__(self, dataset_name, cfg, distributed, output_dir)
79 json_file = PathManager.get_local_path(self._metadata.json_file)
80 with contextlib.redirect_stdout(io.StringIO()):
---> 81 self._coco_api = COCO(json_file)
82
83 self._kpt_oks_sigmas = cfg.TEST.KEYPOINT_OKS_SIGMAS
/usr/local/lib/python3.6/dist-packages/pycocotools/coco.py in __init__(self, annotation_file)
82 print('loading annotations into memory...')
83 tic = time.time()
---> 84 dataset = json.load(open(annotation_file, 'r'))
85 assert type(dataset)==dict, 'annotation file format {} not supported'.format(type(dataset))
86 print('Done (t={:0.2f}s)'.format(time.time()- tic))
FileNotFoundError: [Errno 2] No such file or directory: './output2/lplates_test_coco_format.json'
Updated issue with Colab Logs
By "logs" I mean all logs like this as you can find in the official colab tutorial. These are still missing. The tutorial has instructions how to setup the logger if you couldn't see the logs.
On deleting the file and running again it gives file not found error
Did you restart Colab runtime? Please always restart before you try something, otherwise the behavior of the code is affected by everything you did in the past.
Those logs aren't generated. I get the error before any of those logs. And yes I restart the runtime before running.
The tutorial has instructions how to setup the logger if you couldn't see the logs.
The generatedfile stopped generation at "width" :
{"info": {"date_created": "2020-09-09 10:17:29.866472", "description": "Automatically generated COCO json file for Detectron2."}, "images": [{"id": 0, "width":
So I figured he issue would be with the data itself where found that width was stored as a numpy object which was creating the issue. Once I updated my preprocessing function to :
info["height"] = int(data.iloc[0].height)
info["width"] = int(data.iloc[0].width)
Now it works. Thank you.
Unable to run model Evaluation with COCOEvaluator
Instructions To Reproduce the Issue:
DatasetCatalog.register("lplates_test", lambda test_df=test_df: preDtron(test_df, classes)) MetadataCatalog.get("lplates_test").set(thing_classes=['NumPlate'])
lplate_metadata = MetadataCatalog.get("lplates_train") test_metadata = MetadataCatalog.get("lplates_test")
def preDtron(df,classes):
cfg = get_cfg() cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")) cfg.DATASETS.TRAIN = ("lplates_train",) cfg.DATASETS.TEST = ("lplates_test",) cfg.DATALOADER.NUM_WORKERS = 4 cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml") # Let training initialize from model zoo cfg.SOLVER.IMS_PER_BATCH = 4 cfg.SOLVER.BASE_LR = 0.01
cfg.SOLVER.MAX_ITER = 600
cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 512 cfg.MODEL.ROI_HEADS.NUM_CLASSES = 1
os.makedirs(cfg.OUTPUT_DIR, exist_ok=True) trainer = DefaultTrainer(cfg) trainer.resume_or_load(resume=False) trainer.train()
evaluator = COCOEvaluator("lplates_test", cfg, False, output_dir="./output2/") val_loader = build_detection_test_loader(cfg, "lplates_test") print(inference_on_dataset(trainer.model, val_loader, evaluator))
{"info": {"date_created": "2020-09-09 10:17:29.866472", "description": "Automatically generated COCO json file for Detectron2."}, "images": [{"id": 0, "width":
JSONDecodeError Traceback (most recent call last)