Currently it seems you are creating the layers in each call, so I doubt the model will learn anything at all.
Try to create a model using the nn.Module class:
class MyModel(nn.Module):
    def __init__(self):
        super(MyModel, self).__init__()
        # your layer definitions
       self.conv1 = nn.Conv2d(...)
       self.conv2 = nn.Conv2d(...)

    def forward(self, x):
        # your forward pass
        x = self.conv1(x)
        x = self....
        return x

Could you try that and have a look, if you still run out of memory?