Did you find a workaround for this issue?
I’m getting the same error. I worked around by increasing num_classes > 1. So in my case if I’m training a network to detect just digit 5 in mnist, I still output 10 classes but my labels are 0-1. where 1 is for digit 5 and 0 is for all other digits.