diff --git a/ultralytics/models/yolo/classify/train.py b/ultralytics/models/yolo/classify/train.py index a7bbe772..42c65542 100644 --- a/ultralytics/models/yolo/classify/train.py +++ b/ultralytics/models/yolo/classify/train.py @@ -73,7 +73,7 @@ class ClassificationTrainer(BaseTrainer): elif model in torchvision.models.__dict__: self.model = torchvision.models.__dict__[model](weights="IMAGENET1K_V1" if self.args.pretrained else None) else: - FileNotFoundError(f"ERROR: model={model} not found locally or online. Please check model name.") + raise FileNotFoundError(f"ERROR: model={model} not found locally or online. Please check model name.") ClassificationModel.reshape_outputs(self.model, self.data["nc"]) return ckpt