YOLOv5 OpenVINO PyTorch Hub inference fix (#7826)

Resolves bug report #7817
This commit is contained in:
Glenn Jocher 2022-05-16 00:56:44 +02:00 committed by GitHub
parent 8aa2085a7e
commit 1e112ced79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo
check_requirements(exclude=('tensorboard', 'thop', 'opencv-python')) check_requirements(exclude=('tensorboard', 'thop', 'opencv-python'))
name = Path(name) 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: try:
device = select_device(('0' if torch.cuda.is_available() else 'cpu') if device is None else device) device = select_device(('0' if torch.cuda.is_available() else 'cpu') if device is None else device)