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

Data not tensor error #9

Open
slowsheep1 opened this issue Aug 19, 2019 · 0 comments
Open

Data not tensor error #9

slowsheep1 opened this issue Aug 19, 2019 · 0 comments

Comments

@slowsheep1
Copy link

Traceback (most recent call last):
File "multi_label_classifier.py", line 337, in
main()
File "multi_label_classifier.py", line 330, in main
train(model, criterion, train_set, val_set, opt, (rid2name, id2rid))
File "multi_label_classifier.py", line 170, in train
output, loss, loss_list = forward_batch(model, criterion, inputs, targets, opt, "Train")
File "multi_label_classifier.py", line 57, in forward_batch
target_vars.append(Variable(targets[index]))
TypeError: Variable data has to be a tensor, but got tuple

I received the above error. Can you please help me understand it. I used label.txt and data.txt in the format given and my dataset is PNGs of 1024x1024. I am trying to train with Resnet50 with load size of 256 and input size of 224. My labels are 8 binary variables with unique names e.g. no_one, yes_one, ... , no_eight, yes_eight. Each label is some combination of the eight attribute values e.g. ["no_one","yes_two",...,"no_seven","no_eight"].

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