Transfer_learning_with_MobileNet_v1 data_augmenter

Hi
when I write the code in the below syntax I confronted with a mentioned error. what’s wong with RadomFlip? I wrote like Tensorflow setup in tuturial.
code:
data_augmentation = tf.keras.Sequential
data_augmentation.add.RadomFlip(‘horizontal’)
data_augmentation.add.RandomRotation(0.2)

error:
AttributeError Traceback (most recent call last)
in
----> 1 augmenter = data_augmenter()
2
3 assert(augmenter.layers[0].name.startswith(‘random_flip’)), “First layer must be RandomFlip”
4 assert augmenter.layers[0].mode == ‘horizontal’, “RadomFlip parameter must be horizontal”
5 assert(augmenter.layers[1].name.startswith(‘random_rotation’)), “Second layer must be RandomRotation”

in data_augmenter()
9 ### START CODE HERE
10 data_augmentation = tf.keras.Sequential
—> 11 data_augmentation.add.RadomFlip(‘horizontal’)
12 data_augmentation.add.RandomRotation(0.2)
13 ### END CODE HERE

AttributeError: ‘function’ object has no attribute ‘RadomFlip’

Should be “random”, not “radom”.

Excuse me
Here I wrote ‘Radom’ but in the code I wrote ‘Random’ and this error was appeared

Be sure you re-run the cell after you fixed the error.

I did it, but this error was appeared

You have added the random flip and random rotation incorrectly.
RandomFlip() and RandomRotation() should not be inside separate parenthesis.
They’re arguments you pass directly using the “add(…)” method.
And you do not need any trailing commas.

1 Like

Thank you. I got it.