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

Error occurred when i run demo.py #35

Open
LongwayX opened this issue Jan 14, 2022 · 5 comments
Open

Error occurred when i run demo.py #35

LongwayX opened this issue Jan 14, 2022 · 5 comments

Comments

@LongwayX
Copy link

Traceback (most recent call last):
File "/mnt/sdb/longwei.xu/PSGAN/demo.py", line 72, in
main()
File "/mnt/sdb/longwei.xu/PSGAN/demo.py", line 57, in main
image, face = inference.transfer(source, reference, with_face=True)
File "/mnt/sdb/longwei.xu/PSGAN/psgan/inference.py", line 33, in transfer
source_input, face, crop_face = self.preprocess(source)
File "/mnt/sdb/longwei.xu/PSGAN/psgan/preprocess.py", line 141, in call
mask = self.face_parse.parse(cv2.resize(np_image, (512, 512)))
File "/mnt/sdb/longwei.xu/PSGAN/faceutils/mask/main.py", line 37, in parse
parsing = torch.nn.functional.embedding(parsing, self.dic)
File "/mnt/sdb/longwei.xu/anaconda3/lib/python3.9/site-packages/torch/nn/functional.py", line 2044, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: 'weight' must be 2-D

parse.shape:
torch.Size([512, 512])
parse
tensor([[ 0, 0, 0, ..., 17, 17, 17],
[ 0, 0, 0, ..., 17, 17, 17],
[ 0, 0, 0, ..., 17, 17, 17],
...,
[17, 17, 17, ..., 16, 16, 16],
[17, 17, 17, ..., 16, 16, 16],
[17, 17, 17, ..., 16, 16, 16]])

@vi-mahi
Copy link

vi-mahi commented Jan 22, 2022

Hello Iam also getting the same error.
Did you resolved this issue.
If solved send me the instructions please.

@LongwayX
Copy link
Author

LongwayX commented Feb 12, 2022 via email

@rdaim
Copy link

rdaim commented Feb 17, 2022

Hello I am also getting the same error. anybody can help me? thanks a lot

@kirylfb
Copy link

kirylfb commented Jul 21, 2022

+1

@wtjiang98
Copy link
Owner

you can refer to #37

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

5 participants