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 name, which you can use as a human-friendly ID.
To display it in the app, add
sys/name
as a column.You can also edit the name in the run information view ( → Run information).
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)
-
 App basics
-
 Run basics
-
 Source code and environment
-
 Charts, plots, and graphs
-
 Files
-
 Artifacts
Instead of uploading file contents in full, you can track metadata of files or directories.
- Track artifacts
- Fetch Artifact metadata
- Tutorial ≫ Data versioning
- API reference ≫
Artifact
-
 Query and download
-
 Turn things off
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.
Code 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. It's set up for image segmentation.
To see how the metadata was logged, take a look at the
train.py
script in the Source code tab.