Unverified 提交 1e112ced authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

YOLOv5 OpenVINO PyTorch Hub inference fix (#7826)

Resolves bug report #7817
上级 8aa2085a
...@@ -39,7 +39,7 @@ def _create(name, pretrained=True, channels=3, classes=80, autoshape=True, verbo ...@@ -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)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论