─░├žeri─če ge├ž

Referans i├žin ultralytics/utils/callbacks/hub.py

Not

Bu dosya https://github.com/ultralytics/ultralytics/blob/main/ ultralytics/utils/callbacks/hub .py adresinde mevcuttur. Bir sorun tespit ederseniz l├╝tfen bir ├çekme ─░ste─či ­čŤá´ŞĆ ile katk─▒da bulunarak d├╝zeltilmesine yard─▒mc─▒ olun. Te┼čekk├╝rler ­čÖĆ!



ultralytics.utils.callbacks.hub.on_pretrain_routine_end(trainer)

Y├╝kleme h─▒z─▒ s─▒n─▒r─▒ i├žin zamanlay─▒c─▒y─▒ ba┼člatmadan ├Ânce bilgileri g├╝nl├╝─če kaydeder.

Kaynak kodu ultralytics/utils/callbacks/hub.py
def on_pretrain_routine_end(trainer):
    """Logs info before starting timer for upload rate limit."""
    session = getattr(trainer, "hub_session", None)
    if session:
        # Start timer for upload rate limit
        session.timers = {"metrics": time(), "ckpt": time()}  # start timer on session.rate_limit



ultralytics.utils.callbacks.hub.on_fit_epoch_end(trainer)

Her epo─čun sonunda e─čitim ilerleme metriklerini y├╝kler.

Kaynak kodu ultralytics/utils/callbacks/hub.py
def on_fit_epoch_end(trainer):
    """Uploads training progress metrics at the end of each epoch."""
    session = getattr(trainer, "hub_session", None)
    if session:
        # Upload metrics after val end
        all_plots = {
            **trainer.label_loss_items(trainer.tloss, prefix="train"),
            **trainer.metrics,
        }
        if trainer.epoch == 0:
            from ultralytics.utils.torch_utils import model_info_for_loggers

            all_plots = {**all_plots, **model_info_for_loggers(trainer)}

        session.metrics_queue[trainer.epoch] = json.dumps(all_plots)

        # If any metrics fail to upload, add them to the queue to attempt uploading again.
        if session.metrics_upload_failed_queue:
            session.metrics_queue.update(session.metrics_upload_failed_queue)

        if time() - session.timers["metrics"] > session.rate_limits["metrics"]:
            session.upload_metrics()
            session.timers["metrics"] = time()  # reset timer
            session.metrics_queue = {}  # reset queue



ultralytics.utils.callbacks.hub.on_model_save(trainer)

Kontrol noktalar─▒n─▒ h─▒z s─▒n─▒rlamas─▒ ile Ultralytics HUB'a kaydeder.

Kaynak kodu ultralytics/utils/callbacks/hub.py
def on_model_save(trainer):
    """Saves checkpoints to Ultralytics HUB with rate limiting."""
    session = getattr(trainer, "hub_session", None)
    if session:
        # Upload checkpoints with rate limiting
        is_best = trainer.best_fitness == trainer.fitness
        if time() - session.timers["ckpt"] > session.rate_limits["ckpt"]:
            LOGGER.info(f"{PREFIX}Uploading checkpoint {HUB_WEB_ROOT}/models/{session.model.id}")
            session.upload_model(trainer.epoch, trainer.last, is_best)
            session.timers["ckpt"] = time()  # reset timer



ultralytics.utils.callbacks.hub.on_train_end(trainer)

E─čitimin sonunda nihai modeli ve metrikleri Ultralytics HUB adresine y├╝kleyin.

Kaynak kodu ultralytics/utils/callbacks/hub.py
def on_train_end(trainer):
    """Upload final model and metrics to Ultralytics HUB at the end of training."""
    session = getattr(trainer, "hub_session", None)
    if session:
        # Upload final model and metrics with exponential standoff
        LOGGER.info(f"{PREFIX}Syncing final model...")
        session.upload_model(
            trainer.epoch,
            trainer.best,
            map=trainer.metrics.get("metrics/mAP50-95(B)", 0),
            final=True,
        )
        session.alive = False  # stop heartbeats
        LOGGER.info(f"{PREFIX}Done Ôťů\n" f"{PREFIX}View model at {session.model_url} ­čÜÇ")



ultralytics.utils.callbacks.hub.on_train_start(trainer)

Tren ba┼člang─▒c─▒nda etkinlikleri ├žal─▒┼čt─▒r─▒n.

Kaynak kodu ultralytics/utils/callbacks/hub.py
def on_train_start(trainer):
    """Run events on train start."""
    events(trainer.args)



ultralytics.utils.callbacks.hub.on_val_start(validator)

Do─črulama ba┼člang─▒c─▒nda olaylar─▒ ├žal─▒┼čt─▒r─▒r.

Kaynak kodu ultralytics/utils/callbacks/hub.py
def on_val_start(validator):
    """Runs events on validation start."""
    events(validator.args)



ultralytics.utils.callbacks.hub.on_predict_start(predictor)

Tahmin ba┼člang─▒c─▒nda etkinlikleri ├žal─▒┼čt─▒r─▒n.

Kaynak kodu ultralytics/utils/callbacks/hub.py
def on_predict_start(predictor):
    """Run events on predict start."""
    events(predictor.args)



ultralytics.utils.callbacks.hub.on_export_start(exporter)

D─▒┼ča aktarma ba┼člang─▒c─▒nda etkinlikleri ├žal─▒┼čt─▒r─▒n.

Kaynak kodu ultralytics/utils/callbacks/hub.py
def on_export_start(exporter):
    """Run events on export start."""
    events(exporter.args)





Created 2023-11-12, Updated 2024-06-02
Authors: glenn-jocher (5), Burhan-Q (1), Laughing-q (1)