In debug mode, Chainer checks values of variables on runtime and shows more detailed error messages. It helps you to debug your programs. Instead it requires additional overhead time.
In debug mode, Chainer checks all results of forward and backward computation, and if it founds a NaN value, it raises RuntimeError
. Some functions and links also check validity of input values.
As of v2.0.0, it is recommended to turn on the debug mode using chainer.config.debug
. See configuration
for the way to use the config object. We leave the reference of the conventional ways (which have been available since Chainer v1) as follows.
chainer.is_debug chainer.set_debug chainer.DebugMode