wtjiang98 / PSGAN

PyTorch code for "PSGAN: Pose and Expression Robust Spatial-Aware GAN for Customizable Makeup Transfer" (CVPR 2020 Oral)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error occurred when i run demo.py

LongwayX opened this issue · comments

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]])

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

commented

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

+1

you can refer to #37