ptrblck:

Note that your current approach will not switch between the linear layers, but call new_logits on top of resnet.logits . Also, y_pred1 isn’t defined in your code.


Yes its a custom resnet model.
The main reason why I do not define y_pred_1 is that both dataset 1 and dataset 2 are having different subjects.
Since the inputs are images of dataset 2, defining y_pred_1 gives an Cuda error due to subject mismatched.
Note that your current approach will not switch between the linear layers,

What would you suggest if I am to switch between the two linear layers?