Well,
AttributeError: 'tuple' object has no attribute 'size' this is because BCE does not take tuple as arguments, but you’re passing labels = labels_mnist, labels_cifar. You might want to treat them as different pairs (MNIST and CIFAR) in the same batch (reduction would also take the job to apply the reduction. That would of course mean you had to do the necessary changes on the model output.
However, I’ve just seen that your concatenating the MNIST and CIFAR results at dimension 1 from the classifier. I’m not sure if that’s intentional. If not, then you could return them as a tuple, what would furthermore help you in the loss part.
However, may I ask why you want to process two different datasets in one forward ‘in parallel’?.
Regards,
Unity05