1 | initial version |
I think that the data should be categorical (also refered as one-hot-encoding) , ie for 2 classes: [1,0] instead of [0], then for mnist, it should be: [1,0,0,0,0,0,0,0,0,0] for class 0, [0,1,0,0,0,0,0,0,0,0] for class 1, etc.
You could find a small description here.
There is plenty of Python methods to do that, but none in OpenCV as far as I know it... But if you implement it, feel free to add a pull request for it (has well as a doc update in another pull request if that solve your issue!)