Closed Annztt closed 7 years ago
Hi Annztt
I'm having this issue now and was wondering how you managed to resolve it given that you closed this issue the very next day?
Thanks, Ogo
Stack overflow to the rescue! I made the same mistake as you :').
"Another common reason you have None where you don't expect it is assignment of an in-place operation on a mutable object. For example:
mylist = mylist.sort() The sort() method of a list sorts the list in-place, that is, mylist is modified. But the actual return value of the method is None and not the list sorted. So you've just assigned None to mylist. If you next try to do, say, mylist.append(1) Python will give you this error."
Your problem happens when you load weights:
model = model.load_weights('model/s2s_model.h5')
model.load_weights('model/s2s_model.h5')
return a None
So, instead just runmodel.load_weights('model/s2s_model.h5')
in that cell.
I saved model: model.save_weights('model/s2s_model.h5') and i can load it: model = model.load_weights('model/s2s_model.h5') but have error in predict: AttributeError: 'NoneType' object has no attribute 'predict' how can i fix that?