Your weight’s shape is wrong, it should be 4 dimensional (out_channels x in_channels/groups x kH x kW) as described http://pytorch.org/docs/master/nn.html#torch.nn.functional.conv2d 1. There was a change a while ago that prints clearer error information in such cases