I have tensor named y, which has values from one-hot encoding over class labels: y = [[ 0. 0. 1. ..., 0. 0. 0.],[ 1. 0. 0. ..., 0. 0. 0.],[ 0. 0. 0. ..., 0. 1. 0.], ...,[ 0. 0. 0. ..., 0. 0. 0.],[ 0. 0. 0. ..., 0. 0. 1.],[ 0. 0. 1. ..., 0. 0. 0.]] so here first row has third element as '1' so it represents class label for that image. Am trying to get all class labels from the given one-hot encoded array, or the given example it should be something like this: y = [2,0,8,...,9,2]
Asked
Active
Viewed 3,317 times
1
-
2Possible duplicate of [how to convert one hot encodings into integers](http://stackoverflow.com/questions/42497340/how-to-convert-one-hot-encodings-into-integers) – Franck Dernoncourt Mar 07 '17 at 04:11
-
1You can do that inside tensorflow graph using tf.argmax(y,1) – Harsha Pokkalla Mar 07 '17 at 14:48