From da408394510f536cffc429ce680e22b910033c29 Mon Sep 17 00:00:00 2001
From: Youho99 <44434482+Youho99@users.noreply.github.com>
Date: Wed, 7 Feb 2024 02:28:14 +0100
Subject: [PATCH] `ultralytics 8.1.10` MLFlow, OBB, TFLite and INT8 fixes
 (#8016)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
---
 ultralytics/__init__.py               | 2 +-
 ultralytics/utils/callbacks/mlflow.py | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py
index cf9442a3..940225ae 100644
--- a/ultralytics/__init__.py
+++ b/ultralytics/__init__.py
@@ -1,6 +1,6 @@
 # Ultralytics YOLO 🚀, AGPL-3.0 license
 
-__version__ = "8.1.9"
+__version__ = "8.1.10"
 
 from ultralytics.data.explorer.explorer import Explorer
 from ultralytics.models import RTDETR, SAM, YOLO
diff --git a/ultralytics/utils/callbacks/mlflow.py b/ultralytics/utils/callbacks/mlflow.py
index 9676fe85..1eaf2c3f 100644
--- a/ultralytics/utils/callbacks/mlflow.py
+++ b/ultralytics/utils/callbacks/mlflow.py
@@ -86,9 +86,12 @@ def on_train_epoch_end(trainer):
     """Log training metrics at the end of each train epoch to MLflow."""
     if mlflow:
         mlflow.log_metrics(
-            metrics=SANITIZE(trainer.label_loss_items(trainer.tloss, prefix="train")), step=trainer.epoch
+            metrics={
+                **SANITIZE(trainer.lr),
+                **SANITIZE(trainer.label_loss_items(trainer.tloss, prefix="train")),
+            },
+            step=trainer.epoch,
         )
-        mlflow.log_metrics(metrics=SANITIZE(trainer.lr), step=trainer.epoch)
 
 
 def on_fit_epoch_end(trainer):
@@ -115,6 +118,7 @@ def on_train_end(trainer):
 callbacks = (
     {
         "on_pretrain_routine_end": on_pretrain_routine_end,
+        "on_train_epoch_end": on_train_epoch_end,
         "on_fit_epoch_end": on_fit_epoch_end,
         "on_train_end": on_train_end,
     }