Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Error in dimensions of model outputs while running for inference #13

Open
sujithvemi opened this issue Mar 23, 2021 · 0 comments
Open

Comments

@sujithvemi
Copy link

Hi,

Thanks for this repo, the work is really interesting. I tried to run the given code for the sample data provided and had run into the following problem.

Encode clothing features
Image shape: torch.Size([1, 3, 256, 256])
Label shape: torch.Size([1, 1, 256, 256])
/content/drive/My Drive/projects/FashionPlus/generation/models/pix2pixHD_model.py:407: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
image = Variable(image.cuda(), volatile=True)
Traceback (most recent call last):
File "./encode_clothing_features.py", line 58, in
feat = model.module.encode_features(data['image'], data['label'])
File "/content/drive/My Drive/projects/FashionPlus/generation/models/pix2pixHD_model.py", line 423, in encode_features
val[0, k] = feat_map[idx[0], idx[1] + k, idx[2], idx[3]].data[0]
IndexError: invalid index of a 0-dim tensor. Use tensor.item() in Python or tensor.item<T>() in C++ to convert a 0-dim tensor to a number

I have noticed that you are using "TrainOptions" and don't have an inference script which uses "TestOptions" instead. Is this error potentially due to some parameter problems because of those options? Also, can you please let me know if there are any plans for providing an updated codebase, I think it was mentioned in some other issue that you are planning to.

Thanks in advance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant