Based on the error message it seems you are also passing the model output or target as a tuple while a tensor is expected. Check the type() of both objects and make sure they are valid tensors before passing it to the criterion.