The error is raised as you are trying to pass the dict to the loss function, which expects tensors.
I don’t know where your current model is coming from but I would guess that you might need to pass the different model outputs and corresponding targets to separate loss functions.