You didn’t specify the size argument. The error points to return F.upsample_bilinear(x).
Try something like F.upsample_bilinear(x, [20, 20]).
I’m not sure, what your first try is supposed to do, since you are passing the same size:
F.upsample_bilinear(x, x.size()[2:])