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.
Intelligent_Ad_7692 t1_j292awm wrote
Reply to [D] Simple Questions Thread by AutoModerator
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
​
here is the githttps://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter04_getting-started-with-neural-networks.ipynb
​
thx for any input:)