Resume a run#
To access or resume an existing run, you can reinitialize it by passing its ID to the with_id
argument.
This lets you:
- add new data or visualizations to a previously closed run
- do multi-stage training more easily
- override a field with a new value
- delete data from the run
- fetch metadata in read-only mode
Good to know
- There is no limit to the number of times you can resume a run.
-
The Python file from which a run is resumed is not snapshotted by default.
However, you can upload it by providing the path to the
source_files
argument of theinit_run()
call. For details, see Log source code.
To resume a run:
-
Obtain the Neptune ID of the run.
- The ID is stored in the
sys/id
field. - You can see it displayed in the leftmost column of the Runs table view.
-
If the run is already initialized in the code, you can obtain it programmatically with:
- The ID is stored in the
-
Initialize the run with the ID:
-
Interact with the run as you normally would.
You can override existing fields, delete fields, or create new ones.
Continue logging to an existing run#
Start by reinitializing the run in your code:
Then use the run
object to continue logging metadata as needed.
# 450 is the epoch from where you want to resume training process
checkpoint = 450
# Continue training as usual
for epoch in range(checkpoint, 1000):
run["train/accuracy"].append(0.75)
...
Editing existing metadata#
To edit the value of an existing field, you overwrite it with different data of the same type.
import neptune
run = neptune.init_run() # run ID becomes CLS-44 (for this example)
run["learning_rate"] = 0.01
import neptune
run = neptune.init_run(with_id="CLS-44")
run["learning_rate"] = 0.02
The value of the "learning_rate"
field has been changed to 0.02
instead of 0.01
.
Deleting metadata from a run#
Accessing a run in read-only mode#
If you're just fetching metadata and not logging anything new, you can reinitialize the run in read-only mode. This ensures that the run's metadata won't be modified.
import neptune
run = neptune.init_run(with_id="CLS-123", mode="read-only")
Related
- To learn more about read-only and other modes, see Connection modes.
- Query the Neptune API
- See how to resume any existing Neptune object: Log to an existing object