Run experiments offline

There may be instances when you want to log your training run but don't have access to an Internet connection. In such cases, Comet provides an offline workflow that allows you to track your run and save the results locally on your file system.

By using comet_ml.start(online=False), you can easily create an experiment that logs data directly to disk. Other than the offline logging, the experiment will behave exactly the same as an online experiment, allowing you to track all your metrics and results without an active Internet connection.

1
2
3
4
import comet_ml
experiment = comet_ml.start(online=False)
experiment.log_metrics({'accuracy': 0.5, 'loss': 0.001})
experiment.end()

At the end of your run, the instructions for uploading the run to the Comet UI will be displayed:

COMET INFO: To upload this offline experiment, run:
    comet upload /content/.cometml-runs/54338792a0324a39bc4ce26ae148e97e.zip
Dec. 2, 2024