Skip to content

Delete metadata from a run#

You can delete metadata from a run by connection to it in your code, then using del or pop() on the namespaces or fields you wish to delete.

Using del or pop() cannot be undone.

  1. Resume the run and pass its Neptune ID to the with_id argument:

    import neptune
    
    run = neptune.init_run(
        with_id="CLS-2",
        capture_hardware_metrics=False, # (1)!
        capture_stderr=False,
        capture_stdout=False,
        capture_traceback=False,
        git_ref=False,
        source_code=[],
    )
    
    1. To avoid creating a new monitoring namespace, disable the auto-logging options.
    How do I find the ID?

    The Neptune ID is a unique identifier for the run. The Experiments tab displays it in the leftmost column.

    In the run structure, the ID is stored in the system namespace (sys).

    • If the run is active, you can obtain its ID with run["sys/id"].fetch(). For example:

      >>> run = neptune.init_run()
      ...
      >>> run["sys/id"].fetch()
      'CLS-26'
      
    • If you set a custom run ID, it's stored at sys/custom_run_id:

      >>> run["sys/custom_run_id"].fetch()
      'vigilant-puffin-20bt9'
      
  2. Use del or pop() to delete metadata:

    del run["large_datasets"]
    
    run.pop("large_datasets")
    

Example: Deleting a field from multiple runs#

To remove everything logged in the train/bounding_boxes namespace from particular runs:

run_ids = ["SUN-123", "SUN-124", "SUN-125", ...]
for run_id in run_ids:
    # Resume run
    run = neptune.init_run(
        with_id=run_id,
        capture_hardware_metrics=False,
        capture_stderr=False,
        capture_stdout=False,
        capture_traceback=False,
        git_ref=False,
        source_code=[],
    )

    # Delete images in "train/bounding_boxes" namespace
    del run["train/bounding_boxes"]

    # Close the run
    run.stop()

Related