diff --git a/models/yolo.py b/models/yolo.py index c196d46f9efa..305f0ca0cc88 100644 --- a/models/yolo.py +++ b/models/yolo.py @@ -90,7 +90,7 @@ def __init__(self, cfg='yolov5s.yaml', ch=3, nc=None, anchors=None): # model, i else: # is *.yaml import yaml # for torch hub self.yaml_file = Path(cfg).name - with open(cfg, errors='ignore') as f: + with open(cfg, encoding='ascii', errors='ignore') as f: self.yaml = yaml.safe_load(f) # model dict # Define model