Skip to main content
App version: 3.4.12

Migrate from Neptune Legacy (2.x)

This guide shows how to:

  • Copy run data from Neptune Legacy (app.neptune.ai) to Neptune (scale.neptune.ai).
  • Update your code from neptune to neptune-scale.

Copy runs from Neptune Legacy

To copy runs from Neptune 2.x to Neptune 3.x, use the run migration utility.

Migrate from Neptune Legacy Python client

Learn about the code changes that you must implement in your existing scripts before migrating from version 1.x of the Neptune client library to neptune-scale.

Installation

neptune 1.x
pip install neptune
neptune-scale
pip install neptune-scale

Import

neptune 1.x
import neptune
neptune-scale
import neptune_scale

Run operations

For details on all parameters and methods, see Run.

Initialize a run

neptune 1.x
run = neptune.init_run()
neptune-scale
run = neptune_scale.Run()

sync()

neptune 1.x
run.sync()
neptune-scale
run.wait_for_processing()

wait()

neptune 1.x
run.wait()
neptune-scale
run.wait_for_submission()

Stop a run

neptune 1.x
run.stop()
neptune-scale
run.close()

Logging metadata

For details on supported metadata types, see Attribute types reference.

Add tags

neptune 1.x
run["sys/tags"].add(["tag1", "tag2", ...])
neptune-scale
run.add_tags(["tag1", "tag2", ...])
Add group tags
neptune 1.x
run["sys/group_tags"].add(["tag1", "tag2", ...])
neptune-scale
run.add_tags(["tag1", "tag2", ...], group_tags=True)

Log a dictionary of values

neptune 1.x
run["config"] = stringify_unsupported(config_dict)
neptune-scale
run.log_configs(
data={"config": config_dict},
flatten=True, # handles nested structures
cast_unsupported=True, # enables type casting
)

Log metrics

neptune 1.x
run["metrics"].append({"acc": acc, "loss": loss, ...})
neptune-scale
run.log_metrics(
data={"metrics/acc": acc, "metrics/loss": loss, ...},
step=step
)
note

log_metrics() requires the step parameter. An option to automatically increase the step value isn't supported yet.

Log files

Upload a single file:

neptune 1.x
run["sample"].upload("my_file.png")
neptune-scale
run.assign_files("my_file.png")

Upload a series of files associated with steps:

neptune 1.x
run["predictions"].append("my_file.png")
neptune-scale
run.log_files(files={predictions: "my_file.png"}, step=step)

Log series of text

neptune 1.x
run["logs"].append("some_string")
neptune-scale
run.log_string_series("some_string")