The error messages you'll see most
Three TF errors will eat 80% of your debugging time. Recognizing them on sight saves hours.
Error 1: incompatible matmul shapes. tf.matmul(a, b) requires a.shape[-1] == b.shape[-2]. The fix is usually a tf.transpose on one operand. The shorthand tf.matmul(a, b, transpose_b=True) avoids creating an intermediate tensor.
Error 2: forgot the batch dimension. Models trained on (batch, ...) will choke on a single sample with shape (...). tf.expand_dims(x, axis=0) or x[tf.newaxis] fixes it.
Error 3: dtype mismatch. NumPy creates float64 by default; TF expects float32. Cast at the boundary: tf.cast(np_array, tf.float32). This is the most common silent bug in image pipelines that load PNG/JPEG and forget to normalize from uint8 0–255 to float32 0–1.