Skip to content

Reference for ultralytics/utils/callbacks/raytune.py

Note

This file is available at https://github.com/ultralytics/ultralytics/blob/main/ultralytics/utils/callbacks/raytune.py. If you spot a problem please help fix it by contributing a Pull Request πŸ› οΈ. Thank you πŸ™!


ultralytics.utils.callbacks.raytune.on_fit_epoch_end

on_fit_epoch_end(trainer)

Sends training metrics to Ray Tune at end of each epoch.

Source code in ultralytics/utils/callbacks/raytune.py
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)




πŸ“… Created 11 months ago ✏️ Updated 1 month ago