From 6551e7d51b51541d5b7306fc685d45f45f9e2790 Mon Sep 17 00:00:00 2001 From: Laughing-q <1185102784@qq.com> Date: Wed, 30 Oct 2024 21:04:34 +0800 Subject: [PATCH] revert comment --- ultralytics/engine/exporter.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ultralytics/engine/exporter.py b/ultralytics/engine/exporter.py index 4cce2f814a..54ed5cd35f 100644 --- a/ultralytics/engine/exporter.py +++ b/ultralytics/engine/exporter.py @@ -1171,21 +1171,21 @@ class Exporter: onnx.save(model_onnx, f) - # if not LINUX: - # LOGGER.warning(f"{prefix} WARNING ⚠️ MCT imx500-converter is only supported on Linux.") - # else: - # check_requirements("imx500-converter[pt]==3.14.1") - # try: - # import subprocess - # - # subprocess.run(["java", "--version"], check=True) - # except FileNotFoundError: - # LOGGER.error( - # "Java 17 is required for the imx500 conversion. \n Please install Java with: \n sudo apt install openjdk-17-jdk openjdk-17-jre" - # ) - # return None - # - # subprocess.run(["imxconv-pt", "-i", "yolov8n_mct_model.onnx", "-o", "yolov8n_imx500_model"], check=True) + if not LINUX: + LOGGER.warning(f"{prefix} WARNING ⚠️ MCT imx500-converter is only supported on Linux.") + else: + check_requirements("imx500-converter[pt]==3.14.1") + try: + import subprocess + + subprocess.run(["java", "--version"], check=True) + except FileNotFoundError: + LOGGER.error( + "Java 17 is required for the imx500 conversion. \n Please install Java with: \n sudo apt install openjdk-17-jdk openjdk-17-jre" + ) + return None + + subprocess.run(["imxconv-pt", "-i", "yolov8n_mct_model.onnx", "-o", "yolov8n_imx500_model"], check=True) return f, None