Debugging options#
You can debug your code by adjusting the connection mode in which Neptune is working.
You can set the mode either through an environment variable (NEPTUNE_MODE
) or through the mode
argument when initializing a Neptune object.
Related
For details, see Connnection modes reference.
Using Neptune in debug mode#
Debug mode essentially turns off all the Neptune-related logging.
You can use Neptune as a mock object for testing purposes by initializing a run in debug mode.
Setting debug mode in integrations#
If you're using Neptune as part of an integration with another framework, you have largely the same options for setting the logging mode:
- Set the
NEPTUNE_MODE
environment variable to a value of"debug"
. -
Alternatively, you can set
mode="debug"
wherever you can pass custom initialization arguments to the Neptune callback or logger. This is indicated by the**neptune_run_kwargs
parameter in the function definition.For example:
from pytorch_lightning.loggers import NeptuneLogger neptune_logger = NeptuneLogger(mode="debug") # (1)! ...
- Normally you could pass other
neptune.init_run()
arguments here, such asname
,description
, ortags
.
For callbacks that take a Neptune run as an argument, you can pass a run that's been initialized in debug mode:
- Normally you could pass other
Using Neptune in synchronous mode#
In synchronous mode, tracking methods throw exceptions in case of issues related to connectivity or the consistency of an object's local representation.
If there's an issue with your code but you're not sure where, synchronous mode can help you locate the problematic part.
Note
This mode may slow down your logging.