mirror of
https://github.com/ultralytics/yolov5.git
synced 2025-06-03 14:49:29 +08:00
Update hubconf.py to reset LOGGER.level after load (#8674)
Resolves silent outputs after model load
This commit is contained in:
parent
4c1784bd15
commit
38721de7ef
@ -34,6 +34,7 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo
|
|||||||
from utils.general import LOGGER, check_requirements, intersect_dicts, logging
|
from utils.general import LOGGER, check_requirements, intersect_dicts, logging
|
||||||
from utils.torch_utils import select_device
|
from utils.torch_utils import select_device
|
||||||
|
|
||||||
|
level = LOGGER.level
|
||||||
if not verbose:
|
if not verbose:
|
||||||
LOGGER.setLevel(logging.WARNING)
|
LOGGER.setLevel(logging.WARNING)
|
||||||
check_requirements(exclude=('tensorboard', 'thop', 'opencv-python'))
|
check_requirements(exclude=('tensorboard', 'thop', 'opencv-python'))
|
||||||
@ -57,6 +58,7 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo
|
|||||||
model.names = ckpt['model'].names # set class names attribute
|
model.names = ckpt['model'].names # set class names attribute
|
||||||
if autoshape:
|
if autoshape:
|
||||||
model = AutoShape(model) # for file/URI/PIL/cv2/np inputs and NMS
|
model = AutoShape(model) # for file/URI/PIL/cv2/np inputs and NMS
|
||||||
|
LOGGER.setLevel(level)
|
||||||
return model.to(device)
|
return model.to(device)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user