Fix Ray Tune error (#17416)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
pull/10254/merge
Mohammed Yasin 4 days ago committed by GitHub
parent 33cdaa5782
commit 318a218cbd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      ultralytics/utils/callbacks/raytune.py

@ -16,8 +16,7 @@ def on_fit_epoch_end(trainer):
"""Sends training metrics to Ray Tune at end of each epoch."""
if ray.train._internal.session._get_session(): # replacement for deprecated ray.tune.is_session_enabled()
metrics = trainer.metrics
metrics["epoch"] = trainer.epoch
session.report(metrics)
session.report({**metrics, **{"epoch": trainer.epoch + 1}})
callbacks = (

Loading…
Cancel
Save