The code snippet is unfortunately not executable and the common input shapes such as [batch_size, 3, 224, 224] and [batch_size, 3, 256, 256] yield shape mismatches, so I cannot really debug it.
However, based on the error message it seems that you are passing a GPU tensor to the model, while the model’s parameters are on the CPU. You can add debug print statements inside the forward methods and check the activation’s .device attribute to isolate the issue.