实现人脸识别性别之路---

correct_prediction = tf.equal(tf.argmax(y_pre,1), tf.argmax(v_ys,1))

argmax的第二个参数的值为1的时候,表示每一列比较求出最大值。当argmax为1的时候,表示求出每一行的最大值

import numpy as np

test = np.array([[1,2,3],[3,9,6],[7,5,9]])

print(np.argmax(test,0))

print(np.argmax(test,1))

运行结果:

[2 1 2]

[2 1 2]

猜你喜欢

转载自www.cnblogs.com/MyUniverse/p/9461031.html