Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: expected scalar type Long but found Double #5

Open
RyanMills19 opened this issue Aug 2, 2020 · 0 comments
Open

RuntimeError: expected scalar type Long but found Double #5

RyanMills19 opened this issue Aug 2, 2020 · 0 comments

Comments

@RyanMills19
Copy link

I'm using a dataset I scraped but same structure comments with rating 0-10, using the same commands as provided except group_labels=0

Traceback (most recent call last):
  File "train.py", line 415, in <module>
    run(args)
  File "train.py", line 297, in run
    training_loss, training_accuracy, train_f1 = train(model,
  File "train.py", line 50, in train
    loss = criterion(predictions, labels)
  File "C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\loss.py", line 915, in forward
    return F.cross_entropy(input, target, weight=self.weight,
  File "C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\functional.py", line 2021, in cross_entropy
    return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
  File "C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\functional.py", line 1838, in nll_loss
    ret = torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
RuntimeError: expected scalar type Long but found Double
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant