Please look at the way Dense is referenced keeping in mind that keras is not imported.
Do brush up on python before moving forward.
Use tf.keras.layers.Dense(…)
or you may just import keras from tensorflow by adding the line above before the code-
from tensorflow import keras
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
The grader might just pick certain cells. So, unless you import keras from tensorflow inside one of the graded functions, odds are good that it won’t work. Why not use tf.keras
?