torch version: 1.9.1+cpu
When I run the demo in torch.nn.quantized.Conv1d
m = nn.quantized.Conv1d(16, 33, 3, stride=2)
input = torch.randn(20, 16, 100)
# quantize input to quint8
q_input = torch.quantize_per_tensor(input, scale=1.0, zero_point=0,dtype=torch.quint8)
output = m(q_input)
I got the following error, do you have any suggestions?
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-36-b9b5fcef4003> in <module>
8 # quantize input to quint8
9 q_input = torch.quantize_per_tensor(input, scale=1.0, zero_point=0,dtype=torch.quint8)
---> 10 output = m(q_input)
~/.local/lib/python3.6/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
1049 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
1050 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1051 return forward_call(*input, **kwargs)
1052 # Do not call functions when jit is used
1053 full_backward_hooks, non_full_backward_hooks = [], []
~/.local/lib/python3.6/site-packages/torch/nn/quantized/modules/conv.py in forward(self, input)
328 input = F.pad(input, _reversed_padding_repeated_twice,
329 mode=self.padding_mode)
--> 330 return ops.quantized.conv1d(input, self._packed_params, self.scale, self.zero_point)
331
332 @classmethod
RuntimeError: [QConv2D] each dimension of output tensor should be greater than 0