Summary
In this chapter, we learned how to debug the code for building and training models in TensorFlow. We learned that we can fetch the tensors as NumPy arrays using tf.Session.run()
. We can also print the values of tensors by adding tf.Print()
operations in the computation graph. We also learned how to raise errors when certain conditions fail to hold during execution with tf.Assert()
and other tf.assert_*
operations. We closed the chapter with an introduction to the TensorFlow debugger (tfdbg
) for setting breakpoints and watching the values of tensors like we would do for debugging the code in the Python debugger (pdb
) or the GNU debugger (gdb
).
This chapter brings our journey to a new milestone. We do not expect that the journey ends here, but we believe that the journey just got started and you will further expand and apply the knowledge and skills gained in this book.
We are keenly looking forward to hearing your experiences, feedback, and suggestions.Â