Weird error at prog. work Transfer_learning_with_MobileNet_v1

following code keeps poping error. They work on my pc though. Seems something wrong with server.

data_augmentation = tf.keras.Sequential()
data_augmentation.add(tf.keras.layers.RandomFlip(‘horizontal’))
data_augmentation.add(tf.keras.layers.RandomRotation(0.2))

AttributeError: module ‘tensorflow.keras.layers’ has no attribute ‘RandomRotation’

It depends on which version of TensorFlow you are using. Things can change if you use a different version. Please read the “import” cell early in the notebook, which shows you the names of the functions you need:

import matplotlib.pyplot as plt
import numpy as np
import os
import tensorflow as tf
import tensorflow.keras.layers as tfl

from tensorflow.keras.preprocessing import image_dataset_from_directory
from tensorflow.keras.layers.experimental.preprocessing import RandomFlip, RandomRotation

So you should just reference them by the names they imported. You can see that the names you used are different than what they are using.

No, this means your PC has a newer (and incompatible) version of the tools and packages.

The assignments are intended to run on Coursera Labs.

thanks Paul, I did forget to check import Cell.

Thanks TMosh, my stupid to assume they are of the same version.

Have a great Christmas Paul!

Have a great Christmas TMosh!