diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 9caf612852..3ab357bd9c 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = "8.2.54" +__version__ = "8.2.55" import os diff --git a/ultralytics/engine/exporter.py b/ultralytics/engine/exporter.py index 9bb6fefdd4..47466e30ff 100644 --- a/ultralytics/engine/exporter.py +++ b/ultralytics/engine/exporter.py @@ -1017,13 +1017,13 @@ class Exporter: """Add metadata to *.tflite models per https://www.tensorflow.org/lite/models/convert/metadata.""" import flatbuffers - if ARM64: - from tflite_support import metadata # noqa - from tflite_support import metadata_schema_py_generated as schema # noqa - else: + try: # TFLite Support bug https://github.com/tensorflow/tflite-support/issues/954#issuecomment-2108570845 from tensorflow_lite_support.metadata import metadata_schema_py_generated as schema # noqa from tensorflow_lite_support.metadata.python import metadata # noqa + except ImportError: # ARM64 systems may not have the 'tensorflow_lite_support' package available + from tflite_support import metadata # noqa + from tflite_support import metadata_schema_py_generated as schema # noqa # Create model info model_meta = schema.ModelMetadataT() diff --git a/ultralytics/hub/utils.py b/ultralytics/hub/utils.py index 2e84c7d3a8..6005609f81 100644 --- a/ultralytics/hub/utils.py +++ b/ultralytics/hub/utils.py @@ -185,7 +185,7 @@ class Events: def __init__(self): """Initializes the Events object with default values for events, rate_limit, and metadata.""" self.events = [] # events list - self.rate_limit = 60.0 # rate limit (seconds) + self.rate_limit = 30.0 # rate limit (seconds) self.t = 0.0 # rate limit timer (seconds) self.metadata = { "cli": Path(ARGV[0]).name == "yolo", diff --git a/ultralytics/utils/torch_utils.py b/ultralytics/utils/torch_utils.py index 0016c97034..ca814b602c 100644 --- a/ultralytics/utils/torch_utils.py +++ b/ultralytics/utils/torch_utils.py @@ -271,7 +271,7 @@ def model_info(model, detailed=False, verbose=True, imgsz=640): fs = f", {flops:.1f} GFLOPs" if flops else "" yaml_file = getattr(model, "yaml_file", "") or getattr(model, "yaml", {}).get("yaml_file", "") model_name = Path(yaml_file).stem.replace("yolo", "YOLO") or "Model" - LOGGER.info(f"{model_name} summary{fused}: {n_l} layers, {n_p} parameters, {n_g} gradients{fs}") + LOGGER.info(f"{model_name} summary{fused}: {n_l:,} layers, {n_p:,} parameters, {n_g:,} gradients{fs}") return n_l, n_p, n_g, flops @@ -513,6 +513,9 @@ def strip_optimizer(f: Union[str, Path] = "best.pt", s: str = "") -> None: for f in Path('path/to/model/checkpoints').rglob('*.pt'): strip_optimizer(f) ``` + + Note: + Use `ultralytics.nn.torch_safe_load` for missing modules with `x = torch_safe_load(f)[0]` """ try: x = torch.load(f, map_location=torch.device("cpu"))