Keras模型的predict_proba()方法不存在 [英] predict_proba() method of Keras model does not exist

查看:328
本文介绍了Keras模型的predict_proba()方法不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过调用Keras模型的predict_proba()生成班级成绩,但似乎该功能不存在!是否因为我在Google中看到了一些示例而弃用了?我正在使用Keras 2.2.2.

I am trying to generate class scores by calling predict_proba() of Keras model, but it seems that this function does not exist! Is it deprecated because I see some examples in Google? I am using Keras 2.2.2.

推荐答案

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()).

这篇关于Keras模型的predict_proba()方法不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆