From 46fa3d4092a561a8d67d0bb775d6d537694f6cbf Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 1 May 2021 18:15:17 +0200 Subject: [PATCH] Hubconf.py bug fix (#3007) --- hubconf.py | 2 +- utils/google_utils.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hubconf.py b/hubconf.py index 7359a58bd324..898b63b5d0b1 100644 --- a/hubconf.py +++ b/hubconf.py @@ -62,7 +62,7 @@ def create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbos def custom(path='path/to/model.pt', autoshape=True, verbose=True): # YOLOv5 custom or local model - return create(path, autoshape, verbose) + return create(path, autoshape=autoshape, verbose=verbose) def yolov5s(pretrained=True, channels=3, classes=80, autoshape=True, verbose=True): diff --git a/utils/google_utils.py b/utils/google_utils.py index eae2d1b9ffcc..63d3e5b212f3 100644 --- a/utils/google_utils.py +++ b/utils/google_utils.py @@ -21,6 +21,7 @@ def attempt_download(file, repo='ultralytics/yolov5'): file = Path(str(file).strip().replace("'", '')) if not file.exists(): + file.parent.mkdir(parents=True, exist_ok=True) # make parent dir (if required) try: response = requests.get(f'https://api.github.com/repos/{repo}/releases/latest').json() # github api assets = [x['name'] for x in response['assets']] # release assets, i.e. ['yolov5s.pt', 'yolov5m.pt', ...]