shaoanlu / faceswap-GAN

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

InvalidArgumentError: input must be 4-dimensional[64,64,3] #149

Closed Ankit050 closed 5 years ago

Ankit050 commented 5 years ago

In FaceSwap_GAN_v2.2_train_test.ipynb, when I try to execute the following code block,

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 get the error :


InvalidArgumentError: input must be 4-dimensional[64,64,3]
     [[{{node model_24/conv2d_157/convolution}}]]

How do i resolve this?

vmartinv commented 5 years ago

I had a similar error which somehow was solved by downgrading Keras to 2.2.5 (I had had >=2.3.0). Hope it helps!

Ankit050 commented 5 years ago

It worked, after I trained it enough.

Thanks though!