NameError: name 'keras' is not defined

Hey guys,

I have similar issue. I tried to import keras correctly using

from tensorflow import keras

in the first section, or adding tf before keras mention in Dense call in the section number 2:

model = tf.keras.Sequential(
        [tf.keras.layers.Dense(units=1, input_shape=[1])]
    )

the issue with grader still persist:

There was a problem compiling the code from your notebook. Details:
name ‘keras’ is not defined

Any help would be highly appreciated

1 Like