Call setup_logger in DefaultTrainer if logger is not enabled (facebookresearch/detectron2/issues/591)
Summary: Pull Request resolved:
@@ -237,6 +237,9 @@ class DefaultTrainer(SimpleTrainer):
Args:
cfg (CfgNode):
"""
+ logger = logging.getLogger("detectron2")
+ if not logger.isEnabledFor(logging.INFO): # setup_logger is not called for d2
+ setup_logger()
# Assume these objects must be constructed in this order.
model = self.build_model(cfg)
optimizer = self.build_optimizer(cfg, model)
