diff --git a/sahi/models/detectron2.py b/sahi/models/detectron2.py index e8ce35d9..c79940f0 100644 --- a/sahi/models/detectron2.py +++ b/sahi/models/detectron2.py @@ -28,11 +28,13 @@ def load_model(self): try: # try to load from model zoo config_file = model_zoo.get_config_file(self.config_path) + cfg.set_new_allowed(True) cfg.merge_from_file(config_file) cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url(self.config_path) except Exception as e: # try to load from local print(e) if self.config_path is not None: + cfg.set_new_allowed(True) cfg.merge_from_file(self.config_path) cfg.MODEL.WEIGHTS = self.model_path