Skip to content

Check input size for CUDA convolutions #1406

@colesbury

Description

@colesbury

For example:

import torch
input = torch.autograd.Variable(torch.randn(3, 3, 7, 7))
x = torch.nn.Conv2d(1, 10, 3, 3)

The CPU version correctly gives an error:

>>> x(input)
RuntimeError: Need input of dimension 4 and input.size[1] == 1 but got input to be of shape: [3 x 3 x 7 x 7]

But the CUDA/cuDNN version gives an ambiguous error RuntimeError: CUDNN_STATUS_BAD_PARAM:

>>> x.cuda()(input.cuda())
RuntimeError: CUDNN_STATUS_BAD_PARAM

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions