Expected object of scalar type Long but got scalar type Float for argument #2 'mat2'

I am sorry, but I still cannot solve my problems through others' methods. I use windows10, and everything went smoothly in the last four lectures, but in lecture 5 when I try to follow the codes from Jeremy step by step this error just occurs.


This is the last version of the error with the type of the data as below, I set the y_train/valid with long because of the CrossEntropyLoss, and I set the x_train/valid float because of the learn.lr_find:
image
I think the error occurs because it goes in output = input.matmul(weight.t()), I mean I don’t think it should goes to this sentence because the input.dim equels to 2 and the bias is True. It should go to this sentence
image
What confused me more is in learn.lr_find it goes into this sentence and everything is right, but in learn.fit_one_cycle it just goes into the wrong sentence and I could not figure out why.
I will be appreciate for any response!