如何将 decode_predictions() 用于非 Imagenet 模型..?
数据挖掘
神经网络
深度学习
喀拉斯
美国有线电视新闻网
2022-02-24 20:19:19
1个回答
在深度学习中,当你执行预测时,你会得到预测,它是一个包含 9 个概率的数组。所以首先对它们进行以下操作。
import numpy as np
prediction = model.prediction(test_data)
# prediction will contain [[0.6, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05]]
prediction = np.argmax(prediction[0])
# Now predition hold the index of the (0.6) i.e max probability value
现在,您应该有一个字典,其中包含 0、1、2、.. 8 的键和 classname1、classname2、...classname9 的值
这是您将类名作为输出的方式
其它你可能感兴趣的问题

