This code snippet works:
class VGGkModule(nn.Module):
    def __init__(self):
        super(VGGkModule,self).__init__()
        self.layer1 = vgg16(pretrained=False)
     
    def forward(self,x):
        x = x.view(-1,5,3,224,224)
        y1 = self.layer1(x[:,0])
        return y1

x = Variable(torch.randn(10, 5, 3, 224, 224))
model = VGGkModule()
output = model(x)

Could you post the complete error message? Probably another layer is throwing this error.