Replies: 1 comment
-
I learned everything I need from here: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear Community,
I'm beginner in the field of Object Detection and I try my first project. I was able to detect with your Colab Demo the object of my dataset with Mask R-CNN. Thanks for that ! :D
Then I noticed that there are new Baselines for Mask R-CNN with better mAP-results. Unfortunately I'm still not able to run the same Colab Demo with the new Baselines. I read the documentary and other similar problems but without success. Thats the reason I'm asking here. How should I modify this peace of code to be able running training with new Baselines?
This is the Demo I used.
`from detectron2.engine import DefaultTrainer
cfg = get_cfg()
cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml"))
cfg.DATASETS.TRAIN = ("balloon_train",)
cfg.DATASETS.TEST = ()
cfg.DATALOADER.NUM_WORKERS = 2
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
cfg.SOLVER.IMS_PER_BATCH = 2
cfg.SOLVER.BASE_LR = 0.00025
cfg.SOLVER.MAX_ITER = 300
cfg.SOLVER.STEPS = []
cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 128
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()`
Know I tried to change if according to LazyConfig-System. But at this point I'm not able to let it run.
from detectron2.config import instantiate from detectron2.model_zoo import get_config model_name="new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_100ep_LSJ.py" cfg = LazyConfig.load(model_zoo.get_config_file(model_name)) cfg.dataloader.train.dataset.names = 'my_dataset_train' cfg.dataloader.test.dataset.names = 'my_dataset_test' cfg.MAX_ITER = 3000 cfg.NUM_CLASSES = 1 cfg.lr = 0.01 trainer = DefaultTrainer(cfg) trainer.resume_or_load(resume=False) trainer.train()
I'm greatfull for any help. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions