shaoanlu / faceswap-GAN

A denoising autoencoder + adversarial losses and attention mechanisms for face swapping.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error on face transform

krunt opened this issue · comments

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?

hi, is your problem fixed?

yes, I do not encounter it anymore

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

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