Putting it all together
The code for training the custom model with the ability to perform evaluations and a hook to save the best model remains the same as in sw. However, the configuration should be as follows:
# Codes to generate cfg object are removed for space effc. # Solver cfg.SOLVER.IMS_PER_BATCH = 6 cfg.SOLVER.BASE_LR = 0.001 cfg.SOLVER.WARMUP_ITERS = 1000 cfg.SOLVER.MOMENTUM = 0.9 cfg.SOLVER.STEPS = (3000, 4000) cfg.SOLVER.GAMMA = 0.5 cfg.SOLVER.NESTROV = False cfg.SOLVER.MAX_ITER = 5000 # checkpoint cfg.SOLVER.CHECKPOINT_PERIOD = 500 # anchors cfg.MODEL.ANCHOR_GENERATOR.SIZES = [[68.33245953, 112.91302277, 89.55701886, 144.71037342, 47.77637482]] cfg.MODEL.ANCHOR_GENERATOR.ASPECT_RATIOS = [[0.99819939, 0.78726896, 1.23598428]] # pixels cfg.MODEL.PIXEL_MEAN = [20.1962, 20.1962, 20.1962] cfg.MODEL.PIXEL_STD = [39.5985, 39.5985, 39.5985] # Other params similar to prev. chapter are removed here
Please refer to the complete Jupyter notebook on GitHub...