-
I am training a model Mask-RCCN with 488 image over 500 steps with the following configuration: cfg = get_cfg()
cfg.MODEL.DEVICE = "cuda"
cfg.OUTPUT_DIR = "drive/MyDrive/detectron2/models"
cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml"))
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
cfg.DATALOADER.NUM_WORKERS = 2
cfg.SOLVER.IMS_PER_BATCH = 2
num_gpu = 1
bs = (num_gpu * 2)
cfg.SOLVER.BASE_LR = 0.02 * bs / 16
cfg.SOLVER.MAX_ITER = (5000)
cfg.SOLVER.STEPS = []
cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = (512)
cfg.MODEL.ROI_HEADS.NUM_CLASSES = 14 # 13 classes + 1 With the following data augmentation. def build_sem_seg_train_aug(cfg):
augs = [
T.RandomBrightness(0.9, 1.1),
T.RandomContrast(0.9, 1.1),
T.RandomSaturation(0.9, 1.1),
T.RandomRotation(angle=[-10, 10], expand=True),
T.RandomFlip(prob=0.5, horizontal=True, vertical=False),
T.RandomFlip(prob=0.5, horizontal=False, vertical=True),
T.Resize(shape=(800, 800))
]
if cfg.INPUT.CROP.ENABLED:
augs.append(
T.RandomCrop_CategoryAreaConstraint(
cfg.INPUT.CROP.TYPE,
cfg.INPUT.CROP.SIZE,
cfg.INPUT.CROP.SINGLE_CATEGORY_MAX_AREA,
cfg.MODEL.SEM_SEG_HEAD.IGNORE_VALUE,
)
)
return augs
Any help will be welcome. |
Beta Was this translation helpful? Give feedback.
Answered by
cris-m
Mar 4, 2023
Replies: 1 comment
-
After adjusting the data augmentation methods and the model architecture I fixed the issue. I think. the data augmentation method was to aggressive which lead to model overfilling |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
cris-m
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After adjusting the data augmentation methods and the model architecture I fixed the issue. I think. the data augmentation method was to aggressive which lead to model overfilling