you need to return the output of forward
def forward(self, x):
    x = self.block1(x)
    x = self.block2(x)
    x = self.block3(x)
    x = self.block4(x)
    x = self.block5(x)
    x = x.view(x.shape[0],-1)
    x = self.classifier(x)
    return x