Upsample for 5D tensor is not implemented?

Does PyTorch 0.3.0 support Upsample for volumetric input (BatchSize, C, D, H, W)?
Though the docs say it support 3-D, 4-D or 5-D tensor, I got the following error:

A = torch.ones(4,5,10,10,10)
up = torch.nn.Upsample(scale_factor=2, mode=‘bilinear’)
B = up(A)
NotImplementedError: Got 5D input, but bilinear mode needs 4D input

Using the PyTorch 0.3.0 as well. Got the same error.
@Shunsuke_Saito Have you figured out why the error comes out here?

Thanks!

Just figured it out.
For 5D, we need the upsampling strategy to be ‘trilinear’ rather than the ‘bilinear’.

Good luck!

3 Likes

Thanks, this is the correct answer.