Could you try to format your code? It’s quite hard to read it at the moment.
Just paste it between:
```
your code
```
It seems that some Modules are still on CPU.
Try to create VGGkModule in your LinearModule in the __init__ function:
class LinearModule(nn.Module):
    def __init__(self):
        super(LinearModule, self).__init__()
        self.layer1 = nn.Linear(5000, 1000)
        self.net = VGGkModule()

    def forward(self, x):
        x = self.net(x)
        x = self.layer1(x)
        return x

The LinearModule does not know anything about net, so it cannot push it to the GPU.