The predict_classes
method is only available for the Sequential
class (which is the class of your first model) but not for the Model
class (the class of your second model).
With the Model
class, you can use the predict
method which will give you a vector of probabilities and then get the argmax of this vector (with np.argmax(y_pred1,axis=1)
).