Exercise 1 data_augmenter error

I ran all of the prior modules to load packages and I’m trying to add RandomFlip using:
tf.keras.layers.RandomFlip(‘horizontal’)

I get the following error when posting:
AttributeError: module ‘tensorflow.keras.layers’ has no attribute ‘RandomFlip’

I’m stuck. Thanks for any help.

In the version of TensorFlow that Coursera uses, RandomFlip() is in an “experimental” package.

But do not worry about this. RandomFlip was already imported in the first cell of the notebook:
image

So all you need to write in your code is “RandomFlip()”, without specifying the package source.

2 Likes

Thank you! I’ll look for that in the future!