Neptune client for Python

Python client is the main way of logging things to Neptune and there are way more materials on how to use it. Go here to read them.

To log metadata to Neptune you just need to install neptune-client and add a snippet to your code. See how to do that in 3 steps.

Step 1: Install Neptune client

Depending on your operating system open a terminal or CMD and run this command:

pip install neptune-client
conda install -c conda-forge neptune-client

This integration is tested with neptune-client==0.9.16

Learn more about the installation.

Step 2: Add logging snippet to your scripts

import as neptune
run = neptune.init(project='common/quickstarts',
# Track metadata and hyperparameters of your run
run["JIRA"] = "NPT-952"
run["algorithm"] = "ConvNet"
params = {
"batch_size": 64,
"dropout": 0.2,
"learning_rate": 0.001,
"optimizer": "Adam"
run["parameters"] = params
# Track the training process by logging your training metrics
for epoch in range(100):
run["train/accuracy"].log(epoch * 0.6)
run["train/loss"].log(epoch * 0.4)
# Log the final results
run["f1_score"] = 0.66
# Stop logging

Step 3: Stop logging

Once you are done logging, you should stop tracking the run using the stop() method. This is needed only while logging from a notebook environment. While logging through a script, Neptune automatically stops tracking once the script has completed execution.


Step 4: Execute your run normally