From ebbbdd7e2576f02154ef930df74fc564012776dc Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 23 Mar 2024 21:18:15 +0100 Subject: [PATCH] Fix `IS_PYTHON_3_12` bug (#9258) Co-authored-by: UltralyticsAssistant --- .github/workflows/ci.yaml | 2 +- ultralytics/utils/checks.py | 2 +- ultralytics/utils/torch_utils.py | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7d5633b1..9154d134 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -222,7 +222,7 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} Conda: - if: github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule_disabled' || github.event.inputs.conda == 'true') + if: github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event.inputs.conda == 'true') runs-on: ${{ matrix.os }} strategy: fail-fast: false diff --git a/ultralytics/utils/checks.py b/ultralytics/utils/checks.py index 106fa4e1..e584a5b7 100644 --- a/ultralytics/utils/checks.py +++ b/ultralytics/utils/checks.py @@ -726,4 +726,4 @@ def cuda_is_available() -> bool: # Define constants -IS_PYTHON_3_12 = check_version(PYTHON_VERSION, "==3.12", name="Python ", hard=False) +IS_PYTHON_3_12 = PYTHON_VERSION.startswith("3.12") diff --git a/ultralytics/utils/torch_utils.py b/ultralytics/utils/torch_utils.py index ea0cdf19..77d8cc8c 100644 --- a/ultralytics/utils/torch_utils.py +++ b/ultralytics/utils/torch_utils.py @@ -24,6 +24,7 @@ try: except ImportError: thop = None +# Version checks (all default to version>=min_version) TORCH_1_9 = check_version(torch.__version__, "1.9.0") TORCH_1_13 = check_version(torch.__version__, "1.13.0") TORCH_2_0 = check_version(torch.__version__, "2.0.0")