Open yangchengtest opened 4 years ago
Hi,@yangchengtest. I met the same problem, and it seems like only one of size and scale_factor in torch.nn.functional.interpolate should be defined, so I believe that the author forgot this.Absolutely, when size is given, the scale_factor is forbidden to use,thus your implemetation is right, and the best way to process scale_factor is to delete it, I assume,like this: _if size: if isinstance(size,int): upsample_param.upsample_h = size else:
upsample_param.upsample_h = size[0]
upsample_param.upsample_w = size[1]_
I'm not familiar with Pytorch,so point out my error please.
Hi,@yangchengtest. I met the same problem, and it seems like only one of size and scale_factor in torch.nn.functional.interpolate should be defined, so I believe that the author forgot this.Absolutely, when size is given, the scale_factor is forbidden to use,thus your implemetation is right, and the best way to process scale_factor is to delete it, I assume,like this: _if size: if isinstance(size,int): upsample_param.upsample_h = size else: # scale_factor = 1 upsample_param.upsample_h = size[0] upsample_param.upsamplew = size[1] I'm not familiar with Pytorch,so point out my error please.
In fact, it can get same result
when size is not None,scale_factor is None.There is an error.
Can I change the code to: else: if not scale_factor: scale_factor = 1 upsample_param.upsample_h = size[0] * scale_factor