Debugging and solving error messages
As you go through the exercises or walk through the code in this book, in any other resource, or in your own personal projects, you will quickly realize how often code breaks, and mastering how to resolve these errors will help you to move quickly through your learning process or when building projects. First, when you get an error, it is important to check what the error message is. Next is to understand the meaning of the error message. Let us look at some errors that a few students stumbled upon when implementing basic operations in TensorFlow. Let’s run the following code to generate a new vector:
tf.variable([1,2,3,4])
Running this code will throw the error shown in the following screenshot:
Figure 2.8 – Example of an error
From the error message, we can see that there is no attribute called variable
in TensorFlow. This draws our attention to where the error is coming from and we immediately...