From daaac35fffe0889ce3e6371fff0253434b5f0c9b Mon Sep 17 00:00:00 2001 From: Lakshantha Dissanayake Date: Thu, 31 Oct 2024 17:12:29 -0700 Subject: [PATCH] Skip MNN export for Raspberry Pi and NVIDIA Jetson (#17292) Co-authored-by: Glenn Jocher Co-authored-by: UltralyticsAssistant --- tests/test_exports.py | 1 + ultralytics/engine/exporter.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tests/test_exports.py b/tests/test_exports.py index a05f0e05..5a54b1af 100644 --- a/tests/test_exports.py +++ b/tests/test_exports.py @@ -193,6 +193,7 @@ def test_export_paddle(): @pytest.mark.slow +@pytest.mark.skipif(IS_RASPBERRYPI, reason="MNN not supported on Raspberry Pi") def test_export_mnn(): """Test YOLO exports to MNN format (WARNING: MNN test must precede NCNN test or CI error on Windows).""" file = YOLO(MODEL).export(format="mnn", imgsz=32) diff --git a/ultralytics/engine/exporter.py b/ultralytics/engine/exporter.py index ea8d03b4..223454f6 100644 --- a/ultralytics/engine/exporter.py +++ b/ultralytics/engine/exporter.py @@ -77,6 +77,7 @@ from ultralytics.utils import ( ARM64, DEFAULT_CFG, IS_JETSON, + IS_RASPBERRYPI, LINUX, LOGGER, MACOS, @@ -244,6 +245,8 @@ class Exporter: "WARNING ⚠️ INT8 export requires a missing 'data' arg for calibration. " f"Using default 'data={self.args.data}'." ) + if mnn and (IS_RASPBERRYPI or IS_JETSON): + raise SystemError("MNN export not supported on Raspberry Pi and NVIDIA Jetson") # Input im = torch.zeros(self.args.batch, 3, *self.imgsz).to(self.device) file = Path(