In debug mode, Chainer checks values of variables on runtime and shows more detailed error messages. It helps you to debug your programs. However, it requires some additional overhead time.
You can enable debug mode with
with chainer.using_config('debug', True): ...
See Configuring Chainer for Chainer’s configuration mechanism.
You can also set
CHAINER_DEBUG environment variable to
1 to enable this mode.
In debug mode, Chainer checks all results of forward and backward computation, and if it finds a NaN value, it raises
Some functions and links also check validity of input values.
You can check if debug mode is enabled with
||Get the debug mode.|
||Set the debug mode.|
As of v2.0.0, it is recommended to turn on the debug mode using
See Configuring Chainer for the way to use the config object.
We leave the reference of the conventional way (which has been available since Chainer v1) as follows.
||Debug mode context.|