Skip to content

'indices' to have scalar type Long error #5

@eashaankumar

Description

@eashaankumar

This code does not work when I try to run the run.py script. It throws this error:

1083 2 2 Traceback (most recent call last): File "run.py", line 48, in <module> wrap.fit(pij, i, j) File "C:\github\topicsne\wrapper.py", line 44, in fit loss = self.model(*datas) File "C:\github\topicsne\vtsne.py", line 67, in __call__ return self.forward(*args) File "C:\github\topicsne\vtsne.py", line 57, in forward xi, _ = self.sample_logits(i) File "C:\github\topicsne\vtsne.py", line 46, in sample_logits return self.reparametrize(self.logits_mu(i), self.logits_lv(i)) File "C:\Users\easha\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__ result = self.forward(*input, **kwargs) File "C:\Users\easha\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\sparse.py", line 118, in forward self.norm_type, self.scale_grad_by_freq, self.sparse) File "C:\Users\easha\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\functional.py", line 1454, in embedding return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse) RuntimeError: Expected tensor for argument #1 'indices' to have scalar type Long; but got torch.cuda.IntTensor instead (while checking arguments for embedding)

I tried to mess around with the suggested data types, but that doesn't seem to solve the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions