shaoanlu / faceswap-GAN

A denoising autoencoder + adversarial losses and attention mechanisms for face swapping.
3.39k stars 841 forks source link

error on face transform #160

Closed krunt closed 4 years ago

krunt commented 4 years ago

When I am running this line in FaceSwap_GAN_v2.2_train_test.ipynb result_img, result_rgb, result_mask = ftrans.transform( aligned_det_face_im, direction="AtoB", roi_coverage=0.93, color_correction="adain_xyz", IMAGE_SHAPE=(RESOLUTION, RESOLUTION, 3) )
I got this error: Invalid argument: transpose expects a vector of size 3. But input(1) is a vector of size 4 [[{{node model_22/conv2d_157/convolution-0-TransposeNHWCToNCHW-LayoutOptimizer}}]] [[concatenate_24/concat/_2775]] Has anybody encountered this?

Heonozis commented 4 years ago

bump

zhoumu53 commented 4 years ago

hi, is your problem fixed?

krunt commented 4 years ago

yes, I do not encounter it anymore

zhoumu53 commented 4 years ago

how do you fix it? I met the same problem.

wukailu commented 4 years ago

I solved it! My solution

  1. downgrade Keras to 2.2.5 or 2. add ae_input = np.array([ae_input]) to the begining of _ae_forward_pass in face_transformer.py