Week2-assignment2-function data_augmenter()-function RandomFlip() can't be used

I do appreciate your help!!


when i import RamdomFlip() from tf.keras.layers, it still can’t work

Try restarting the kernel, then run all of the cells in the notebook.

The RandomFlip() and RandomRotation() functions are imported in the fist cell in the “1 - Packages” section. Do not add your own import code.

Thanks TMosh.
I’ve tried as you said, but the same problem arose。。。i don’t know why

RandomFlip and RandomRotation is in package “tensorflow.keras.layers.experimental.preprocessing”. It’s imported in “1 - Packages”, so you only write “RandomFlip()” instead of “tfl.RandomFlip()”

thanks Simon~
I’ve tried it before as I mentioned. I’ve used two ways to import(the other is tfl, what I have learned from another answer) but things just don’t go well… I’m totally confused…

The only time you need to import a tf package is by running the first cell in the notebook.
After that, you only have to use the correct syntax for that layer.

i don’t know why

Note that the problem in your original post is that you spelled “RandomFlip” incorrectly. You had an ‘m’ where it should have been an ‘n’.

That’s the wrong layer name. “Random”, not “Ramdom”.

oh gosh!!!
yeah you’re right !!!
i’m so careless………………