I just want to do some numerical validation inside the custom layer.
Suppose we have a very simple custom layer:
class test_layer(keras.layers.Layer
Yes. The call()
method is only used to build the computational graph.
As to the debug. I prefer using TFDBG
, which is a recommended debugging tool for tensorflow, although it doesn't provide break point functions.
For Keras, you can add these line to your script to use TFDBG
import tf.keras.backend as K
from tensorflow.python import debug as tf_debug
sess = K.get_session()
sess = tf_debug.LocalCLIDebugWrapperSession(sess)
K.set_session(sess)