Ok. So I learned that long is a type of tensor.  I changed my categorical variables to type(np.int32) from type(np.int64) to get rid of the long.  However, when i do that, this error comes up:


RuntimeError                              Traceback (most recent call last)
 in 
9             break
10
—> 11         y_pred = d_o_model(num, cat)
12         single_loss = criterion(y_pred, label)
13         aggregated_losses.append(single_loss)
C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in call(self, *input, **kwargs)
539             result = self._slow_forward(*input, **kwargs)
540         else:
–> 541             result = self.forward(*input, **kwargs)
542         for hook in self._forward_hooks.values():
543             hook_result = hook(self, input, result)
 in forward(self, x_categorical, x_numerical)
47         embeddings = []
48         for i,e in enumerate(self.all_embeddings):
—> 49             embeddings.append(e(x_categorical[:,i]))
50
51         x = torch.cat(embeddings, 1)
C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py in call(self, *input, **kwargs)
539             result = self._slow_forward(*input, **kwargs)
540         else:
–> 541             result = self.forward(*input, **kwargs)
542         for hook in self._forward_hooks.values():
543             hook_result = hook(self, input, result)
C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\sparse.py in forward(self, input)
112         return F.embedding(
113             input, self.weight, self.padding_idx, self.max_norm,
–> 114             self.norm_type, self.scale_grad_by_freq, self.sparse)
115
116     def extra_repr(self):
C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\functional.py in embedding(input, weight, padding_idx, max_norm, norm_type, scale_grad_by_freq, sparse)
1482         # remove once script supports set_grad_enabled
1483         no_grad_embedding_renorm(weight, input, max_norm, norm_type)
-> 1484     return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
1485
1486
RuntimeError: Expected tensor for argument #1 ‘indices’ to have scalar type Long; but got torch.IntTensor instead (while checking arguments for embedding)

So if I don’t have my categorical variables long type, then the above error happens.  If I do then the first post batch normalization error happens.  i feel like i’m in a catch-22.  Has anyone had to deal with this?