glenn-jocher commited on
Commit
38721de
·
unverified ·
1 Parent(s): 4c1784b

Update hubconf.py to reset LOGGER.level after load (#8674)

Browse files
Files changed (1) hide show
  1. hubconf.py +2 -0
hubconf.py CHANGED
@@ -34,6 +34,7 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo
34
  from utils.general import LOGGER, check_requirements, intersect_dicts, logging
35
  from utils.torch_utils import select_device
36
 
 
37
  if not verbose:
38
  LOGGER.setLevel(logging.WARNING)
39
  check_requirements(exclude=('tensorboard', 'thop', 'opencv-python'))
@@ -57,6 +58,7 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo
57
  model.names = ckpt['model'].names # set class names attribute
58
  if autoshape:
59
  model = AutoShape(model) # for file/URI/PIL/cv2/np inputs and NMS
 
60
  return model.to(device)
61
 
62
  except Exception as e:
 
34
  from utils.general import LOGGER, check_requirements, intersect_dicts, logging
35
  from utils.torch_utils import select_device
36
 
37
+ level = LOGGER.level
38
  if not verbose:
39
  LOGGER.setLevel(logging.WARNING)
40
  check_requirements(exclude=('tensorboard', 'thop', 'opencv-python'))
 
58
  model.names = ckpt['model'].names # set class names attribute
59
  if autoshape:
60
  model = AutoShape(model) # for file/URI/PIL/cv2/np inputs and NMS
61
+ LOGGER.setLevel(level)
62
  return model.to(device)
63
 
64
  except Exception as e: