C1W1 - Assignment - AttributeError: 'History' object has no attribute 'predict'

Dear all,

I have the following error after running the last cell:


AttributeError Traceback (most recent call last)
in
2
3 new_x = 7.0
----> 4 prediction = model.predict([new_x])[0]
5 print(prediction)

AttributeError: ‘History’ object has no attribute ‘predict’

Everything before this cell were compiled properly with no errors.

Any idea about what is going on?

Tks

1 Like

Return an instance of Model and not History from the house_model method.

Try this:

model = house_model()
assert type(model) == tf.keras.Sequential
1 Like