我在 keras 中使用预训练模型并最终预测类索引为一些整数值,但我似乎不明白如何打印这些类的名称?
我使用的模型是 ResNet 50。
编辑:仍然无法弄清楚,让我回答编辑它真的很重要。
请您参考如下方法:
看看https://martin-thoma.com/image-classification/
关键部分是:
from imagenet_utils import preprocess_input, decode_predictions
preds = model.predict(x)
print('Predicted:', decode_predictions(preds))
