-
Notifications
You must be signed in to change notification settings - Fork 60
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
Custom dataset #10
Comments
I am not sure what the exact problem is, replacing mini with custom dataset should work. It seems the batch_size of logits and label did not match, could you check their shape? |
yes, the shapes are different .. Are there any constraints for the custom dataset for the code to run? Should I tweak any parameters accordingly? |
I referred to the paper and modified query=3 and shot=3 as per my custom training support. Now the code is working fine. Thanks for the quick response! :) |
I remember there should not be constraints for custom dataset. You may check the intermediate shapes to see what the exact problem is. The shape of logits should be [n_way * n_query, n_way], and shape of label should be [n_way * n_query]. |
Hi.
I was trying out few shot on custom dataset, My custom data has 17 categories and 6 images per category. created a class similar to MiniImageNet and used in it validation, i.e valset. But it is throwing me an error in line 114 as
loss = F.cross_entropy(logits, label)
File "/home/search_env/lib/python3.6/site-packages/torch/nn/functional.py", line 2056, in cross_entropy
return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
File "/home/search_env/lib/python3.6/site-packages/torch/nn/functional.py", line 1869, in nll_loss
.format(input.size(0), target.size(0)))
ValueError: Expected input batch_size (5) to match target batch_size (75).
Am I missing something? Kindly guide
The text was updated successfully, but these errors were encountered: