Confusion matrix output not printing correctly

names is on cuda. So, you might to want to detach it and then convert to numpy array before feeding it into confusion_matrix.