ultralytics 8.0.74 Pose labels, fp64 labels, Ensemble fixes (#1956)

Co-authored-by: jjlira <63210717+jjlira@users.noreply.github.com>
Co-authored-by: Jose Lira <jose.lira@georgebrown.ca>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com>
Co-authored-by: wilsonlmh <lu6ni4z-forum@Yahoo.com.hk>
Co-authored-by: HaeJin Lee <seareale@gmail.com>
This commit is contained in:
Glenn Jocher
2023-04-11 15:30:01 +02:00
committed by GitHub
parent 5629ed0bb7
commit 24363236f2
9 changed files with 41 additions and 32 deletions

View File

@ -166,7 +166,9 @@ class YOLO:
"""
Raises TypeError is model is not a PyTorch model
"""
if not isinstance(self.model, nn.Module):
pt_str = isinstance(self.model, (str, Path)) and Path(self.model).suffix == '.pt'
pt_module = isinstance(self.model, nn.Module)
if not (pt_module or pt_str):
raise TypeError(f"model='{self.model}' must be a *.pt PyTorch model, but is a different type. "
f'PyTorch models can be used to train, val, predict and export, i.e. '
f"'yolo export model=yolov8n.pt', but exported formats like ONNX, TensorRT etc. only "