text: Title: Try using custom_callbacks. Counting accuracy takes a lot of time, so don't use it every epoch.
  Body: Try using custom_callbacks. Counting accuracy takes a lot of time, so don't use it every epoch.
  
  mean_average_precision_callback = modellib.MeanAveragePrecisionCallback(model,\
            model_inference, dataset_val, calculate_map_at_every_X_epoch=5, verbose=1)
  
  model.train(dataset_train, dataset_val, 
              learning_rate=config.LEARNING_RATE, 
              epochs=100,
              layers='heads',
              custom_callbacks=[mean_average_precision_callback])
  
  _Originally posted by @VtlNmnk in https://github.com/matterport/Mask_RCNN/issues/1839#issuecomment-549430332_