@ngimel
def _upsample(x):
    h, w = x.shape[2:]
    return F.upsample_bilinear(x, size=(h * 2, w * 2))


def upsample_conv(x, conv):
    return conv(_upsample(x))

The problem seems to be BatchNorm. It can work when I delete self.b1. And I did not find that self.b2 has a problem. In this code, If I put the first BatchNorm in this order, it could not run.
When I set upsample=False, and it raises the same error.
Can you please tell me how to check if my CUDA and cudnn installation is correct? I installed servral CUDA versions, and I  intalled CUDA-10.0 in path /usr/local/CUDA-10.0. I added the path to the environment variables.Thank you.