【问题标题】:ValueError: `decode_predictions` expects a batch of predictions (i.e. a 2D array of shape (samples, 1000)). Found array with shape: (1, 3)ValueError:`decode_predictions` 需要一批预测(即形状的二维数组(样本,1000))。找到具有形状的数组:(1, 3)
【发布时间】:2018-10-27 10:24:16
【问题描述】:

enter image description here

我已经使用 Google 很长时间了,但他们不会问我同样的问题。他们使用现成的模型。我是一个自我训练的模型,但我对同样的错误感到困惑。

【问题讨论】:

标签: keras


【解决方案1】:

问题是decode_predictions,期望类数为1000(即ImageNet数据集中的类数)。而您的自定义模型似乎只有 3 个输出类:

decode_predictions 需要一批预测(即二维数组 形状(samples, 1000))。找到具有形状的数组:(1, 3)

【讨论】:

    猜你喜欢
    • 2018-08-21
    • 2018-11-16
    • 1970-01-01
    • 2020-07-26
    • 2020-09-01
    • 2018-09-16
    • 1970-01-01
    • 2019-04-24
    • 1970-01-01
    相关资源
    最近更新 更多