[英]Tensorflow argmax() for TFLearn?
I used the mnist data set of tflearn
to predict handwritten digits. 我用MNIST数据集的tflearn
预测手写的数字。
Everything works, but I have the labels as one_hot . 一切正常,但是我的标签为one_hot 。 Is there a function in tflearn
, which does the same as argmax()
in Tensorflow? tflearn
是否有一个函数,与argmax()
一样?
You can do it simply by doing this: 您只需执行以下操作即可:
pred = model.predict(test_data)
print([ np.where(r==1)[0][0] for r in np.round(pred) ])
Best. 最好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.