Using Neptune#
Basic usage
run = neptune.init_run() # (1)!
-
We recommend saving your API token and project name as environment variables.
If needed, you can pass them as arguments when initializing Neptune:
run = neptune.init_run(
name="blobfish-candytuft", # (1)!
tags=["maskRCNN", "finetune"],
source_files=["**/*.py", "config.yaml"],
dependencies="infer",
)
-
Sets a custom run name. To display it in the app, add
sys/name
as a column.You can also edit and view the name in the Run information view.
run["your/structure"] = some_value
run["data/sample"].upload("figure/object/or/path/to/file")
run["data/train/samples/images"].upload_files("path/to/directory")
run["data/train/version"].track_files("path/to/artifacts")
for epoch in range(100):
# your training loop
loss = ...
run["train/loss"].append(loss)
-
 ID, name, and description
-
 Source code and environment
Learn how to enable or disable logging of:
-
 Files
-
 Artifacts
Instead of uploading file contents in full, you can track metadata of files or directories.
- Track artifacts
- Download artifact metadata
- Tutorial ≫ Data versioning
- API ≫
Artifact
-
 Charts, plots, and graphs
-
 Model metadata
You can store metadata of models and manage their lifecycle separately from runs.
Tutorials#
For detailed walkthroughs and use cases, check the Tutorials section.
Each tutorial comes with Jupyter notebooks or scripts (usually both) as well as examples in the Neptune web app.
Examples on GitHub#
In the neptune-ai/examples repo on GitHub, you can browse our full library of example scripts, notebooks, use cases, and Neptune projects.
View examples repository 
Neptune demo project#
To get an idea of what a Neptune project can be used for, you can browse the showcase/onboarding-project
sample project, which is set up for image segmentation.
Tip: Take a look at the train.py
script in the Source code view to see how the metadata was logged.