January 2018
Intermediate to advanced
474 pages
10h 23m
English
Yet another way to debug TensorFlow models is to insert conditional asserts. The tf.Assert() function takes a condition, and if the condition is false, it then prints the lists of given tensors and throws tf.errors.InvalidArgumentError.
tf.Assert( condition, data, summarize=None, name=None)
assert_op = tf.Assert(tf.reduce_all(tf.greater_equal(x,0)),[x])
Read now
Unlock full access