AttributeError: ‘Sequential‘ object has no attribute ‘predict_classes‘ 解决方法

TensorFlow版本问题,predict_classes函数被删除了

可以使用

yhat = model.predict(xhat)
classes_x=np.argmax(yhat,axis=1)

替代

yhat = model.predict_classes(xhat)

猜你喜欢

转载自blog.csdn.net/weixin_43989856/article/details/127265306