From 1a497f174c21993e2464725d96482e2a4a52758b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:08:02 +0200 Subject: [PATCH 1/6] Bump slackapi/slack-github-action from 1.26.0 to 1.27.0 in /.github/workflows (#15945) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- .github/workflows/docker.yaml | 2 +- .github/workflows/publish.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c079a5a075..11bc4c7771 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -344,7 +344,7 @@ jobs: steps: - name: Check for failure and notify if: (needs.HUB.result == 'failure' || needs.Benchmarks.result == 'failure' || needs.Tests.result == 'failure' || needs.GPU.result == 'failure' || needs.RaspberryPi.result == 'failure' || needs.Conda.result == 'failure' ) && github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event_name == 'push') - uses: slackapi/slack-github-action@v1.26.0 + uses: slackapi/slack-github-action@v1.27.0 with: payload: | {"text": " GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n"} diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 6cd7b5ca46..5242d9efa6 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -175,7 +175,7 @@ jobs: - name: Notify on failure if: github.event_name == 'push' && failure() # do not notify on cancelled() as cancelling is performed by hand - uses: slackapi/slack-github-action@v1.26.0 + uses: slackapi/slack-github-action@v1.27.0 with: payload: | {"text": " GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n"} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e0bb3fa38e..3cb83f27fd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -127,7 +127,7 @@ jobs: echo "PR_TITLE=$PR_TITLE" >> $GITHUB_ENV - name: Notify on Slack (Success) if: success() && github.event_name == 'push' && steps.check_pypi.outputs.increment == 'True' - uses: slackapi/slack-github-action@v1.26.0 + uses: slackapi/slack-github-action@v1.27.0 with: payload: | {"text": " GitHub Actions success for ${{ github.workflow }} ✅\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* NEW '${{ github.repository }} ${{ steps.check_pypi.outputs.current_tag }}' pip package published 😃\n*Job Status:* ${{ job.status }}\n*Pull Request:* ${{ env.PR_TITLE }}\n"} @@ -135,7 +135,7 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }} - name: Notify on Slack (Failure) if: failure() - uses: slackapi/slack-github-action@v1.26.0 + uses: slackapi/slack-github-action@v1.27.0 with: payload: | {"text": " GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n*Job Status:* ${{ job.status }}\n*Pull Request:* ${{ env.PR_TITLE }}\n"} From 5b3e60b4525f1b757bf4b1b8d78a273f7133e358 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Mon, 2 Sep 2024 20:00:02 +0200 Subject: [PATCH 2/6] Continue on Conda CI error (#15958) --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 11bc4c7771..0ea3a5a1ec 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -269,6 +269,7 @@ jobs: Conda: if: github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event.inputs.conda == 'true') + continue-on-error: true runs-on: ${{ matrix.os }} strategy: fail-fast: false From 5a6db149e45a4ff4efef6d970a87e0693b8271e2 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 3 Sep 2024 11:10:09 +0200 Subject: [PATCH 3/6] Update `test_workflow` to ONNX (#15974) --- tests/test_python.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_python.py b/tests/test_python.py index f15dd48eff..8fbab54cf2 100644 --- a/tests/test_python.py +++ b/tests/test_python.py @@ -202,7 +202,7 @@ def test_workflow(): model.train(data="coco8.yaml", epochs=1, imgsz=32, optimizer="SGD") model.val(imgsz=32) model.predict(SOURCE, imgsz=32) - model.export(format="torchscript") + model.export(format="onnx") def test_predict_callback_and_setup(): From 7c7f456710d8f4c538453fda96fb0ea1d4e84d7a Mon Sep 17 00:00:00 2001 From: Laughing <61612323+Laughing-q@users.noreply.github.com> Date: Tue, 3 Sep 2024 18:03:01 +0800 Subject: [PATCH 4/6] Fix `torch.cuda.amp.GradScaler` warning (#15978) Co-authored-by: UltralyticsAssistant --- ultralytics/engine/trainer.py | 5 ++++- ultralytics/utils/torch_utils.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ultralytics/engine/trainer.py b/ultralytics/engine/trainer.py index c5b8a13f30..2d5fc62461 100644 --- a/ultralytics/engine/trainer.py +++ b/ultralytics/engine/trainer.py @@ -42,6 +42,7 @@ from ultralytics.utils.checks import check_amp, check_file, check_imgsz, check_m from ultralytics.utils.dist import ddp_cleanup, generate_ddp_command from ultralytics.utils.files import get_latest_run from ultralytics.utils.torch_utils import ( + TORCH_2_4, EarlyStopping, ModelEMA, autocast, @@ -265,7 +266,9 @@ class BaseTrainer: if RANK > -1 and world_size > 1: # DDP dist.broadcast(self.amp, src=0) # broadcast the tensor from rank 0 to all other ranks (returns None) self.amp = bool(self.amp) # as boolean - self.scaler = torch.cuda.amp.GradScaler(enabled=self.amp) + self.scaler = ( + torch.amp.GradScaler("cuda", enabled=self.amp) if TORCH_2_4 else torch.cuda.amp.GradScaler(enabled=self.amp) + ) if world_size > 1: self.model = nn.parallel.DistributedDataParallel(self.model, device_ids=[RANK], find_unused_parameters=True) diff --git a/ultralytics/utils/torch_utils.py b/ultralytics/utils/torch_utils.py index c2338e184b..16bcddadd0 100644 --- a/ultralytics/utils/torch_utils.py +++ b/ultralytics/utils/torch_utils.py @@ -40,6 +40,7 @@ except ImportError: 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") +TORCH_2_4 = check_version(torch.__version__, "2.4.0") TORCHVISION_0_10 = check_version(TORCHVISION_VERSION, "0.10.0") TORCHVISION_0_11 = check_version(TORCHVISION_VERSION, "0.11.0") TORCHVISION_0_13 = check_version(TORCHVISION_VERSION, "0.13.0") From b2ab667f0086c501a5fc4620049c8bf3c9646e85 Mon Sep 17 00:00:00 2001 From: TechWolf21 Date: Tue, 3 Sep 2024 16:08:23 +0530 Subject: [PATCH 5/6] Fix queue `counts` (#15971) Co-authored-by: UltralyticsAssistant Co-authored-by: Muhammad Rizwan Munawar Co-authored-by: RizwanMunawar Co-authored-by: Glenn Jocher --- ultralytics/solutions/queue_management.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ultralytics/solutions/queue_management.py b/ultralytics/solutions/queue_management.py index f3536d30eb..16df28b1bb 100644 --- a/ultralytics/solutions/queue_management.py +++ b/ultralytics/solutions/queue_management.py @@ -89,7 +89,7 @@ class QueueManager: """Extracts and processes tracks for queue management in a video stream.""" # Initialize annotator and draw the queue region self.annotator = Annotator(self.im0, self.tf, self.names) - + self.counts = 0 # Reset counts every frame if tracks[0].boxes.id is not None: boxes = tracks[0].boxes.xyxy.cpu() clss = tracks[0].boxes.cls.cpu().tolist() @@ -132,7 +132,6 @@ class QueueManager: txt_color=self.count_txt_color, ) - self.counts = 0 # Reset counts after displaying self.display_frames() def display_frames(self): From 3fc14b5fec93f365e7a2318e410b79f879cf5004 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 3 Sep 2024 12:43:48 +0200 Subject: [PATCH 6/6] `ultralytics 8.2.87` Ray `shutdown()` workers after tuning (#15976) --- tests/test_python.py | 2 +- ultralytics/__init__.py | 2 +- ultralytics/utils/tuner.py | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/test_python.py b/tests/test_python.py index 8fbab54cf2..f15dd48eff 100644 --- a/tests/test_python.py +++ b/tests/test_python.py @@ -202,7 +202,7 @@ def test_workflow(): model.train(data="coco8.yaml", epochs=1, imgsz=32, optimizer="SGD") model.val(imgsz=32) model.predict(SOURCE, imgsz=32) - model.export(format="onnx") + model.export(format="torchscript") def test_predict_callback_and_setup(): diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index e1bbd65619..37925ac9e7 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = "8.2.86" +__version__ = "8.2.87" import os diff --git a/ultralytics/utils/tuner.py b/ultralytics/utils/tuner.py index 1d52e3e0b4..1329bfe6ec 100644 --- a/ultralytics/utils/tuner.py +++ b/ultralytics/utils/tuner.py @@ -143,5 +143,10 @@ def run_ray_tune( # Run the hyperparameter search tuner.fit() - # Return the results of the hyperparameter search - return tuner.get_results() + # Get the results of the hyperparameter search + results = tuner.get_results() + + # Shut down Ray to clean up workers + ray.shutdown() + + return results