C4W2A2 Exercise 1

I get below error trying to define two keras sequential layers for data augmentation: AttributeError: module ‘tensorflow.keras.layers’ has no attribute ‘RandomFlip’. Can you please help?

Hi @ElhamS,

Are you running things on your local system ?

I tried it on my local system, it worked. But it didn’t work in assignment browser.

In different versions of TF, those functions may have different pathnames in the class hierarchy. If you examine the “import” cell in that notebook, you’ll see that you don’t need to “qualify” those function names (RandomFlip and RandomRotation) with a path. BTW I hope you didn’t modify that cell when you were using it locally and then “import” it back to Coursera.

1 Like

Thank you so much @paulinpaloalto . It worked when I removed the path.

1 Like