From 1e112ced798be7328d1ff1918590a7b70d228a2f Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 16 May 2022 00:56:44 +0200 Subject: [PATCH] YOLOv5 OpenVINO PyTorch Hub inference fix (#7826) Resolves bug report #7817 --- hubconf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hubconf.py b/hubconf.py index 4e05149026b3..01f4eba08c81 100644 --- a/hubconf.py +++ b/hubconf.py @@ -39,7 +39,7 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo check_requirements(exclude=('tensorboard', 'thop', 'opencv-python')) name = Path(name) - path = name.with_suffix('.pt') if name.suffix == '' else name # checkpoint path + path = name.with_suffix('.pt') if name.suffix == '' and not name.is_dir() else name # checkpoint path try: device = select_device(('0' if torch.cuda.is_available() else 'cpu') if device is None else device)