Hello everyone
I would like to do DataParallel onto a self-defined network. However, my model is a bit large so that it takes more than one GPUs (I have 4 in total). Like below:
class net(nn.Module):
    def __init__():
        self.module1 = ... # take GPU 0;
        self.module2 = ... # take GPU 3;
    def forward(self, input):
        x = self.module1(input)
        return self.module2(x)

Now, I want to do DataParallel on my input. Whereas, it reports error as “Expected tensor for argument #1 ‘input’ to have the same device as tensor for argument #2 ‘weight’; but device 1 does not equal 0”. I am assuming this error is caused by that my model takes two GPU ?
Please correct me and let me know what should I do for my purpose.
Best