Tensorflow：SyntaxError: unexpected character after line continuation character
For example, editing two lines of code:
tf.keras.layers.MaxPooling2D((2, 2), strides = 2),\ tf.keras.layers.Conv2D(64, (3, 3), padding = 'same',activation = tf.nn.relu)
There seems no problem on the appearance, but according to the error display
SyntaxError: unexpected character after line continuation character
Let’s take a look:
Is there a space after the newline character
\ in the first line? The answer is yes, that's reason why the program will report an error.
Delete the space and the problem is solved.
Also note that not to add things after the
\ , such as a