RuntimeError: Input type (double) and bias type (float) should be the same

Samuel_Lewis: <p>Hi, I’m currently using <a href="https://github.com/VSainteuf/utae-paps/blob/main/src/backbones/utae.py" rel="noopener nofollow ugc">uconvlstm</a> and when trying to train the model I get the following error:<br>
<code>Input type (double) and bias type (fload) should be the same</code></p>
<p>I have searched for similar issues but not sure where to start.</p>
<p>Full stack issue below</p>
<pre><code class="lang-auto">
EPOCH 1/10
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
&lt;ipython-input-16-e53f2e9fca6d&gt; in &lt;module&gt;
      6 
      7     model.train()
----&gt; 8     train_metrics = iterate(
      9         model,
     10         data_loader=train_loader,

11 frames
&lt;ipython-input-11-95ffd484195c&gt; in iterate(model, data_loader, criterion, optimizer, mode, device)
     60       elif mode != 'val':
     61           optimizer.zero_grad()
---&gt; 62           out = model(x, batch_positions=dates)
     63           val_accuracy.append(get_accuracy(out, y))
     64       else:

/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
   1188         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1189                 or _global_forward_hooks or _global_forward_pre_hooks):
-&gt; 1190             return forward_call(*input, **kwargs)
   1191         # Do not call functions when jit is used
   1192         full_backward_hooks, non_full_backward_hooks = [], []

&lt;ipython-input-3-603af17d624d&gt; in forward(self, input, batch_positions)
    369         )  # BxT pad mask
    370 
--&gt; 371         out = self.in_conv.smart_forward(input)
    372 
    373         feature_maps = [out]

&lt;ipython-input-3-603af17d624d&gt; in smart_forward(self, input)
     32                         * self.pad_value
     33                     )
---&gt; 34                     temp[~pad_mask] = self.forward(out[~pad_mask])
     35                     out = temp
     36                 else:

&lt;ipython-input-3-603af17d624d&gt; in forward(self, input)
    110 
    111     def forward(self, input):
--&gt; 112         return self.conv(input)
    113 
    114 

/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
   1188         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1189                 or _global_forward_hooks or _global_forward_pre_hooks):
-&gt; 1190             return forward_call(*input, **kwargs)
   1191         # Do not call functions when jit is used
   1192         full_backward_hooks, non_full_backward_hooks = [], []

&lt;ipython-input-3-603af17d624d&gt; in forward(self, input)
     89 
     90     def forward(self, input):
---&gt; 91         return self.conv(input)
     92 
     93 

/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
   1188         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1189                 or _global_forward_hooks or _global_forward_pre_hooks):
-&gt; 1190             return forward_call(*input, **kwargs)
   1191         # Do not call functions when jit is used
   1192         full_backward_hooks, non_full_backward_hooks = [], []

/usr/local/lib/python3.8/dist-packages/torch/nn/modules/container.py in forward(self, input)
    202     def forward(self, input):
    203         for module in self:
--&gt; 204             input = module(input)
    205         return input
    206 

/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
   1188         if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
   1189                 or _global_forward_hooks or _global_forward_pre_hooks):
-&gt; 1190             return forward_call(*input, **kwargs)
   1191         # Do not call functions when jit is used
   1192         full_backward_hooks, non_full_backward_hooks = [], []

/usr/local/lib/python3.8/dist-packages/torch/nn/modules/conv.py in forward(self, input)
    461 
    462     def forward(self, input: Tensor) -&gt; Tensor:
--&gt; 463         return self._conv_forward(input, self.weight, self.bias)
    464 
    465 class Conv3d(_ConvNd):

/usr/local/lib/python3.8/dist-packages/torch/nn/modules/conv.py in _conv_forward(self, input, weight, bias)
    454     def _conv_forward(self, input: Tensor, weight: Tensor, bias: Optional[Tensor]):
    455         if self.padding_mode != 'zeros':
--&gt; 456             return F.conv2d(F.pad(input, self._reversed_padding_repeated_twice, mode=self.padding_mode),
    457                             weight, bias, self.stride,
    458                             _pair(0), self.dilation, self.groups)

RuntimeError: Input type (double) and bias type (float) should be the same`
</code></pre>
<p>Any help regarding this would be greatly appreciated.</p>

ConvolutionalAtom: <p>1st order guess. Check the type of your input tensor/data.<br>
If it is of <code>double</code> type, turn it into <code>torch.float32</code> type tensor before feeding into model</p>