Why don't I need to specify activation='sigmoid'?

In Week-4 of the transfer learning assignment, the last layer is “use a prediction layer with one neuron (as a binary classifier only needs one)”:

outputs = tf.keras.layers.Dense(1)(x)

Why can’t I use:
outputs = tf.keras.layers.Dense(1, activation='sigmoid')(x)

This will report an error saying that ‘linear’ doesn’t match with sigmoid. Why is that?

Does this help?

@balaji.ambresh Is that because from_logit=True has the same effect of ‘activation=sigmoid’?

You are correct. See this