deep-learningneural-networkfaster-rcnndetectron

Detectron2 difference between SOLVER.IMS_PER_BATCH and MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE in cfg file


In detectron2 there seems to be two settings related to batch size in the config file.

They are

SOLVER.IMS_PER_BATCH and MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE

I have seen both being used as batch size online and not sure how they differ. What is the difference and if they work together, how?


Solution

  • SOLVER.IMS_PER_BATCH is what's commonly known as batch size in deep learning and refers to the number of training examples utilized in one iteration.

    MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE is a parameter that is used to sample a subset of proposals coming out of RPN to calculate cls and reg loss during training.