-
Notifications
You must be signed in to change notification settings - Fork 352
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
Target is not converted to 'Long' error #302
Comments
How are you making your databunch? |
` def get_y_fun(input):
` btw, the regexpr |
I did some testing. its a dataloader issue, nowhere in the datalodaer the targets are casted directly to int64 |
Are you sure you are using PyTorch 1.3? The type-promotion should get rid of those errors. On Linux, I can do |
The first error should be fixed now btw. |
@sgugger, thanks or the feedback.
i upgraded my pytorch to 1.3.1 (requirements are currently 1.2.0). maybe it is better to explicitly convert the targets to int64 in the collate function?
|
We don't want to automatically convert to int64 tensors for users because it takes twice the space in GPU memory and sometimes they don't need the int64. I can't reproduce the error on windows with PyTorch 1.3.1. When asking for the accuracy between a tensor of type Int (int32) and a tensor of type Long (int64), I don't have any error. |
i am trying to run simple PETS dataset training.
when i use the following simple learner with label smooth:
learn = cnn_learner(dbunch, resnet34, metrics=[accuracy, top_k_accuracy], loss_func=LabelSmoothingCrossEntropy()) learn.fit_one_cycle(4)
i get the following error immediately when the training starts:
if i use CrossEntropyLossFlat loss instead, i get an error at the validation phase:
Thanks
The text was updated successfully, but these errors were encountered: