Skip to content

fix bad error message #43

@soumith

Description

@soumith
m = nn.Conv2d(16, 32, (3, 3))
input = autograd.Variable(torch.randn(3, 16, 10, 10))
m(input)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-57-ad2f7eaad9e5> in <module>()
----> 1 m(input)

/home/soumith/local/miniconda2/lib/python2.7/site-packages/torch/nn/modules/module.pyc in __call__(self, *input)
     64
     65     def __call__(self, *input):
---> 66         result = self.forward(*input)
     67         for hook in self.forward_hooks.values():
     68             hook(self, input, result)

/home/soumith/local/miniconda2/lib/python2.7/site-packages/torch/nn/modules/conv.pyc in forward(self, input)
    140             return func(input, self.weight)
    141         else:
--> 142             return func(input, self.weight, self.bias)
    143
    144

/home/soumith/local/miniconda2/lib/python2.7/site-packages/torch/autograd/function.pyc in __call__(self, *input)
     16
     17     def __call__(self, *input):
---> 18         return self._do_forward(*input)
     19
     20     def save_for_backward(self, *tensors):

/home/soumith/local/miniconda2/lib/python2.7/site-packages/torch/autograd/function.pyc in _do_forward(self, *input)
     44             self.previous_functions = [(arg.creator, id(arg)) for arg in input]
     45
---> 46         raw_output = self.forward(*unpacked_input)
     47         if not isinstance(raw_output, tuple):
     48             raw_output = (raw_output,)

/home/soumith/local/miniconda2/lib/python2.7/site-packages/torch/nn/functions/thnn/auto.pyc in forward(self, input, *params)
    134             self.save_for_backward(input, *params)
    135
--> 136         getattr(self._backend, update_output.name)(self._backend.library_state, input, output, *args)
    137         return output
    138

ValueError: Invalid arguments! Got (int, FloatTensor, FloatTensor, DoubleTensor, DoubleTensor, FloatTensor, FloatTensor, int, int, int, int, int, int), but expected (int state, torch.FloatTensor input, torch.FloatTensor output, torch.FloatTensor weight, [torch.FloatTensor bias or None], torch.FloatTensor finput, torch.FloatTensor fgradInput, int kW, int kH, int dW, int dH, int padW, int padH)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions