Skip to content

comet_ml.start ΒΆ

start(
    api_key: Optional[str] = None,
    workspace: Optional[str] = None,
    project: Optional[str] = None,
    project_name: Optional[str] = None,
    experiment_key: Optional[str] = None,
    mode: Optional[str] = None,
    online: Optional[bool] = None,
    source: Optional[str] = None,
    experiment_config: Optional[ExperimentConfig] = None,
) -> CometExperiment

Returns an Experiment object to log data to. It can be used to log data to a new Comet Experiment, append data to an Existing Experiment or continue logging to a running experiment locally.

Parameters:

  • api_key (str, default: None ) –

    Comet API key. It's recommended to configure the API Key with comet login.

  • workspace (str, default: None ) –

    Comet workspace name. If not provided, uses the default workspace.

  • project (str, default: None ) –

    Comet project name. [Deprecated, use project_name instead]

  • project_name (str, default: None ) –

    Comet project name. Defaults to Uncategorized.

  • experiment_key (str, default: None ) –

    The Experiment identifier to be used for logging. This is used either to append data to an Existing Experiment or to control the key of new experiments (for example to match another identifier). Must be an alphanumeric string whose length is between 32 and 50 characters.

  • mode (str, default: None ) –

    Control how the Comet experiment is started.

    • "get_or_create": Starts a fresh experiment if required, or persists logging to an existing one.
    • "get": Continue logging to an existing experiment identified by the experiment_key value.
    • "create": Always creates of a new experiment, useful for HPO sweeps.
  • online (boolean, default: None ) –

    If True, the data will be logged to Comet server, otherwise it will be stored locally in an offline experiment. Default is True.

  • source (str, default: None ) –

    Enables the specification of the origin of an experiment.

  • experiment_config (Optional[ExperimentConfig], default: None ) –

    additional configuration options.

Returns:

  • CometExperiment –

    The initialized Comet Experiment object.

Raises:

  • ValueError –

    If no API Key is set in online mode.

  • ExperimentNotFound –

    If mode="get" and the experiment_key doesn't exist, or you don't have access to it.

  • InvalidExperimentMode –
    • If mode="get" but no experiment_key was passed or configured.
    • If mode="create", an experiment_key was passed or configured and an Experiment with that Key already exists.
Dec. 17, 2024