From 42416bc608b49cbdcb091e81adbb4caaf11eac38 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 11 Apr 2024 18:04:54 +0200 Subject: [PATCH] `ultralytics 8.1.47` PNNX release 20240226 (#9954) Signed-off-by: Glenn Jocher --- ultralytics/__init__.py | 2 +- ultralytics/engine/exporter.py | 16 ++++++---------- ultralytics/nn/autobackend.py | 3 ++- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 4125944ca..58a50e5e7 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = "8.1.46" +__version__ = "8.1.47" from ultralytics.data.explorer.explorer import Explorer from ultralytics.models import RTDETR, SAM, YOLO, YOLOWorld diff --git a/ultralytics/engine/exporter.py b/ultralytics/engine/exporter.py index 54edbf57a..d5addaaf7 100644 --- a/ultralytics/engine/exporter.py +++ b/ultralytics/engine/exporter.py @@ -529,16 +529,12 @@ class Exporter: f"or in {ROOT}. See PNNX repo for full installation instructions." ) system = "macos" if MACOS else "windows" if WINDOWS else "linux-aarch64" if ARM64 else "linux" - - # PNNX link fixed at 20240226 due to bug in 20240410 - # try: - # _, assets = get_github_assets(repo="pnnx/pnnx", retry=True) - # url = [x for x in assets if f"{system}.zip" in x][0] - # except Exception as e: - # url = f"https://github.com/pnnx/pnnx/releases/download/20240226/pnnx-20240226-{system}.zip" - # LOGGER.warning(f"{prefix} WARNING ⚠️ PNNX GitHub assets not found: {e}, using default {url}") - - url = f"https://github.com/pnnx/pnnx/releases/download/20240226/pnnx-20240226-{system}.zip" + try: + _, assets = get_github_assets(repo="pnnx/pnnx", retry=True) + url = [x for x in assets if f"{system}.zip" in x][0] + except Exception as e: + url = f"https://github.com/pnnx/pnnx/releases/download/20240410/pnnx-20240410-{system}.zip" + LOGGER.warning(f"{prefix} WARNING ⚠️ PNNX GitHub assets not found: {e}, using default {url}") asset = attempt_download_asset(url, repo="pnnx/pnnx", release="latest") if check_is_path_safe(Path.cwd(), asset): # avoid path traversal security vulnerability unzip_dir = Path(asset).with_suffix("") diff --git a/ultralytics/nn/autobackend.py b/ultralytics/nn/autobackend.py index 29709cdb9..ac074e082 100644 --- a/ultralytics/nn/autobackend.py +++ b/ultralytics/nn/autobackend.py @@ -540,7 +540,8 @@ class AutoBackend(nn.Module): mat_in = self.pyncnn.Mat(im[0].cpu().numpy()) with self.net.create_extractor() as ex: ex.input(self.net.input_names()[0], mat_in) - y = [np.array(ex.extract(x)[1])[None] for x in self.net.output_names()] + # WARNING: 'output_names' sorted as a temporary fix for https://github.com/pnnx/pnnx/issues/130 + y = [np.array(ex.extract(x)[1])[None] for x in sorted(self.net.output_names())] # NVIDIA Triton Inference Server elif self.triton: