Data_augmenter how to implement DLS Course 4 W2 E2

data_augmentation = tf.keras.Sequential([
  layers.experimental.preprocessing.RandomFlip("horizontal"),
  layers.experimental.preprocessing.RandomRotation(0.2),
])
data_augmentation.add(None)  # how to add image in?
data_augmentation.add(None)

don’t understand how to implement the add . and is the layers I created correct.
Data augmentation | TensorFlow Core this link is not that useful leh. Cannot figure out.

Help guys!

If I am not correct, there are 2 possible different syntax. The first being the one you have used. If you just remove the last 2 lines of code, you should be good to go, i.e.,

data_augmentation = tf.keras.Sequential([
  layers.experimental.preprocessing.RandomFlip("horizontal"),
  layers.experimental.preprocessing.RandomRotation(0.2),
])

This line of code only should do the job. The other way of writing the same thing is

data_augmentation = tf.keras.Sequential()
data_augmentation.add(RandomFlip('horizontal'))
data_augmentation.add(RandomRotation(0.2))
3 Likes

Hey I just tried this morning. It worked thx!

I am glad I could be of some help :grinning_face_with_smiling_eyes:

1 Like