Solved by Nikronic in post #2 
              
              
                Hi, 

Your input data has 3 classes [10, 3] but output has labels from 0 to 5 so you get error for labels bigger than 2. .random_(3) can solve your issue. 
Bests