Could you check the input shapes of all tensors that you are passing to your criterion?
Apparently some of them are empty. However, the error seems to point to the weight argument.
Are you using weighted cross entropy or are you passing the weight manually to the loss calculation?