diff --git a/docs/en/integrations/neural-magic.md b/docs/en/integrations/neural-magic.md index 53910972cd..293c1991df 100644 --- a/docs/en/integrations/neural-magic.md +++ b/docs/en/integrations/neural-magic.md @@ -13,7 +13,7 @@ This guide shows you how to deploy YOLOv8 using Neural Magic's DeepSparse, how t ## Neural Magic’s DeepSparse

- Neural Magic’s DeepSparse Overview + Neural Magic’s DeepSparse Overview

[Neural Magic’s DeepSparse](https://neuralmagic.com/deepsparse/) is an inference run-time designed to optimize the execution of neural networks on CPUs. It applies advanced techniques like sparsity, pruning, and quantization to dramatically reduce computational demands while maintaining accuracy. DeepSparse offers an agile solution for efficient and scalable neural network execution across various devices. diff --git a/docs/en/integrations/paddlepaddle.md b/docs/en/integrations/paddlepaddle.md index 4502b12855..f41116fb4c 100644 --- a/docs/en/integrations/paddlepaddle.md +++ b/docs/en/integrations/paddlepaddle.md @@ -80,7 +80,7 @@ Before diving into the usage instructions, it's important to note that while all model = YOLO('yolov8n.pt') # Export the model to PaddlePaddle format - model.export(format=''paddle'') # creates '/yolov8n_paddle_model' + model.export(format='paddle') # creates '/yolov8n_paddle_model' # Load the exported PaddlePaddle model paddle_model = YOLO('./yolov8n_paddle_model') diff --git a/docs/en/yolov5/tutorials/neural_magic_pruning_quantization.md b/docs/en/yolov5/tutorials/neural_magic_pruning_quantization.md index e0c2528401..37c89c14c5 100644 --- a/docs/en/yolov5/tutorials/neural_magic_pruning_quantization.md +++ b/docs/en/yolov5/tutorials/neural_magic_pruning_quantization.md @@ -52,7 +52,7 @@ Sparse networks with compressed computation, executed depth-wise in cache, allow Neural Magic's open-source model repository, SparseZoo, contains pre-sparsified checkpoints of each YOLOv5 model. Using SparseML, which is integrated with Ultralytics, you can fine-tune a sparse checkpoint onto your data with a single CLI command. -[Checkout Neural Magic's YOLOv5 documentation for more details](https://docs.neuralmagic.com/use-cases/object-detection/sparsifying). +[Checkout Neural Magic's YOLOv5 documentation for more details](https://docs.neuralmagic.com/computer-vision/object-detection/). ## DeepSparse Usage diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index f15d0d6d7a..1a38daf9e3 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = "8.1.29" +__version__ = "8.1.30" from ultralytics.data.explorer.explorer import Explorer from ultralytics.models import RTDETR, SAM, YOLO, YOLOWorld diff --git a/ultralytics/engine/model.py b/ultralytics/engine/model.py index e32c3e45ce..ace045f70d 100644 --- a/ultralytics/engine/model.py +++ b/ultralytics/engine/model.py @@ -124,7 +124,7 @@ class Model(nn.Module): # Check if Ultralytics HUB model from https://hub.ultralytics.com if self.is_hub_model(model): # Fetch model from HUB - checks.check_requirements("hub-sdk>0.0.2") + checks.check_requirements("hub-sdk>=0.0.5") self.session = self._get_hub_session(model) model = self.session.model_file diff --git a/ultralytics/hub/session.py b/ultralytics/hub/session.py index ebc6692b70..ebde7aa30e 100644 --- a/ultralytics/hub/session.py +++ b/ultralytics/hub/session.py @@ -170,10 +170,19 @@ class HUBTrainingSession: return api_key, model_id, filename - def _set_train_args(self, **kwargs): - """Initializes training arguments and creates a model entry on the Ultralytics HUB.""" + def _set_train_args(self): + """ + Initializes training arguments and creates a model entry on the Ultralytics HUB. + + This method sets up training arguments based on the model's state and updates them with any additional + arguments provided. It handles different states of the model, such as whether it's resumable, pretrained, + or requires specific file setup. + + Raises: + ValueError: If the model is already trained, if required dataset information is missing, or if there are + issues with the provided training arguments. + """ if self.model.is_trained(): - # Model is already trained raise ValueError(emojis(f"Model is already trained and uploaded to {self.model_url} 🚀")) if self.model.is_resumable(): @@ -182,26 +191,16 @@ class HUBTrainingSession: self.model_file = self.model.get_weights_url("last") else: # Model has no saved weights - def get_train_args(config): - """Parses an identifier to extract API key, model ID, and filename if applicable.""" - return { - "batch": config["batchSize"], - "epochs": config["epochs"], - "imgsz": config["imageSize"], - "patience": config["patience"], - "device": config["device"], - "cache": config["cache"], - "data": self.model.get_dataset_url(), - } - - self.train_args = get_train_args(self.model.data.get("config")) + self.train_args = self.model.data.get("train_args") # new response + # Set the model file as either a *.pt or *.yaml file self.model_file = ( self.model.get_weights_url("parent") if self.model.is_pretrained() else self.model.get_architecture() ) - if not self.train_args.get("data"): - raise ValueError("Dataset may still be processing. Please wait a minute and try again.") # RF fix + if "data" not in self.train_args: + # RF bug - datasets are sometimes not exported + raise ValueError("Dataset may still be processing. Please wait a minute and try again.") self.model_file = checks.check_yolov5u_filename(self.model_file, verbose=False) # YOLOv5->YOLOv5u self.model_id = self.model.id