PReLU and Conv3d bugs with 5d Tensors

Here is an example of torch.nn.PReLU(num_parameters) acting on a 5d Tensor:

out = nn.PReLU(8)(Variable(torch.rand(2,8,16,16,16)))

The error looks like:

RuntimeError: wrong number of input planes at /data/users/soumith/miniconda2/conda-bld/pytorch-cuda80-0.1.8_1486040640754/work/torch/lib/THNN/generic/PReLU.c:49

Here is an example of torch.nn.Conv3d(bias=False) acting on a 5d Tensor:

out = nn.Conv3d(8,16, kernel_size=3, padding=1, bias=False)(Variable(torch.rand(2,8,16,16,16)))

The error looks like:

TypeError: FloatVolumetricConvolutionMM_updateOutput received an invalid combination of arguments - got (int, torch.FloatTensor, torch.FloatTensor, torch.FloatTensor, NoneType, torch.FloatTensor, int, int, int, int, int, int, int, int, int), but expected (int state, torch.FloatTensor input, torch.FloatTensor output, torch.FloatTensor weight, torch.FloatTensor bias, torch.FloatTensor finput, int kT, int kW, int kH, int dT, int dW, int dH, int pT, int pW, int pH)

Lua Torch had similar problems with 5d Tensors, so maybe this is a back end issue.

Conv3d(bias=False) has a PR fixing it. I’ll merge it in this week and push it into the next release on Wednesday.

Also, it seems that PReLU doesn’t support 5d tensors at the moment. I’ve opened an issue.

1 Like