RuntimeError: expected scalar type Long but found Float #888
Answered
by
LuluW8071
garvpatidar04
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
LuluW8071
Apr 7, 2024
Replies: 1 comment 1 reply
-
Typical datatype error Paste below snippet above your training loop code y_train1 = y_train1.type(torch.LongTensor) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
garvpatidar04
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Typical datatype error
Just change
ytrain1
to long dtype. This is done for labels since labels should be fixed value not floating points.Paste below snippet above your training loop code