Resume a run
If a run was interrupted and became inactive, you can reconnect to it and continue logging metadata.
To resume an existing run, pass the run identifier to the run_id
argument of the Run
constructor:
from neptune_scale import Run
run = Run(run_id="SomeExistingRunId")
After resuming a connection to the run, you can continue logging normally.
Example
Connect to an existing run and log new metadata:
from neptune_scale import Run
if __name__ == "__main__":
run = Run(run_id="seagull-s68kj78")
# continune logging metrics
for step in epoch: # start where the last run left off
run.log_metrics(
...,
step=step,
)
run.add_tags(tags=["best"])
Enable validation of run ID
To check for the existence of a run with the provided run_id
, set the resume
argument to True
when initializing the run:
run = Run(
run_id="SomeExistingRunId",
resume=True, # raise error if run doesn't exist
)
In this case, the NeptuneRunNotFound
exception is raised when Neptune attempts to synchronize the data with the server, and no data is logged.
Don't use
resume=True
in distributed logging setups.
Overwrite existing metadata
Note that calling log_configs()
and passing different values for existing attributes will overwrite the previous values. For details, see Edit run configs.
When logging metrics, previously logged steps are not affected. You can continue logging metrics at any step that's higher than the series' last entry.