且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Keras模型的predict_proba()方法不存在

更新时间:2023-12-02 14:56:46

predict_proba()predict_classes()方法

The predict_proba() and predict_classes() methods are not well-defined for models created using functional API (i.e. keras.models.Model()). That's because the models created using functional API may have multiple output layers each with different configurations. Therefore predicting probabilities in this case is not meaningful, even if your model outputs probabilities. The method you referred to, as well as predict_classes(), is only defined for Sequential models (i.e. keras.models.Sequential()).