In the resnet.py, the following codes should be revised. if self.downsample is not None: residual = self.downsample(x) it should be if self.downsample is not None: residual = self.downsample(residual)