Running Offline

The OfflineExperiment() interface allows you to log your experiment data on your local disk until you are ready to upload it from memory to

To use the offline support, import the OfflineExperiment class at the top of your script rather than Experiment, like this:

python from comet_ml import OfflineExperiment Then change the Experiment() creation line. You need to switch Experiment to OfflineExperiment, take out the API Key argument (if you pass it directly to Experiment), and add the offline_directory argument at the end of the argument list.

Here is an example using Experiment:

```python from comet_ml import Experiment

experiment = Experiment(MY_API_KEY, workspace="WORKSPACE_NAME", project_name="PROJECT_NAME",...) ``` Here is what it would look like for switching to the offline training:

```python from comet_ml import OfflineExperiment

experiment = OfflineExperiment( workspace="WORKSPACE_NAME", project_name="PROJECT_NAME",..., offline_directory="/tmp") ```

Finally, launch your machine learning script as usual. The OfflineExperiment output will slightly differ from using the Experiment object. Specifically, the SDK won’t show a URL anymore. At the end of the script, the SDK will show a message similar to this to tell you where the offline experiment has been saved, and how to upload it:

bash COMET INFO: To upload this offline experiment, run: /usr/bin/python -m comet_ml.scripts.comet_upload /tmp/comet/


You can tell an OfflineExperiment from an Experiment because Comet automatically issues an experiment.log_other("offline_experiment", True) when using an offline experiment.

Uploading OfflineExperiments

To upload your OfflineExperiments to, execute the following command in your command line:

bash $ comet upload /tmp/comet/

To read more about comet upload please see Command-Line Utilities.