Intelligent_Ad_7692

Intelligent_Ad_7692 t1_j292awm wrote

Hello, I am new to the ML community and trying to learn more! Currently I am reading Deep Learning with Python second edition by Francois Chollet. I am trying to run the examples in collaborator, but when I try to run them I am running into errors with NameErrors: " " not defined. Just wanted some help or see if anyone has run into anything similar.

import tensorflow.keras as keras

model = keras.Sequential([

layers.Dense(16, activation="relu"),

layers.Dense(16, activation="relu"),

layers.Dense(1,activation="sigmoid")

])

model.compile(

optimizer="rmsprop",

loss="binary_crossentropy",

metrics=["accuracy"])

model.fit(x_train, y_train, epochs=4, batch_size=512)

results = model.evaluate(x_test, y_test)

---------------------------------------------------------------------------

NameError Traceback (most recent call last)

<ipython-input-2-52370d4415e6> in <module>

2

3 model = keras.Sequential([ ---->

4 layers.Dense(16, activation="relu"),

5 layers.Dense(16, activation="relu"),

6 layers.Dense(1, activation="sigmoid")

NameError: name 'layers' is not defined

&#x200B;

here is the githttps://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter04_getting-started-with-neural-networks.ipynb

&#x200B;

thx for any input:)

1