Rudrabha / LipGAN

This repository contains the codes for LipGAN. LipGAN was published as a part of the paper titled "Towards Automatic Face-to-Face Translation".
http://cvit.iiit.ac.in/research/projects/cvit-projects/facetoface-translation
MIT License
585 stars 124 forks source link

Batch inference of model after training #23

Closed shikhar-scs closed 4 years ago

shikhar-scs commented 4 years ago

Hi, I had trained my model and was trying to test it using batch_inference. However, my generator model gen.h5 got saved as a tuple (look at line 2 in the following pic) and thus, I'm getting

image Also, if I try using either of those models individually, I further get an error that the no. of layers are not consistent with the existing model.

ValueError: You are trying to load a weight file containing 145 layers into a model with 61 layers.

Do I need to change something ?

prajwalkr commented 4 years ago

I have fixed it just now. The error was that the inference code was not choosing the correct model type (it was choosing the basic model instead of the residual one). Pull the changes and it should work. Please let me know if any further issues crop up.

shikhar-scs commented 4 years ago

cool man, thanks its working ! Also, one more thing, I wonder if anyone else faced it too, this line https://github.com/Rudrabha/LipGAN/blob/81c534030ca5472592d4c242f01eedd816fb73f7/train.py#L71

should really be just

img_ip = cv2.imread(ip_fname) 

a similar edit for train_unet.py Just, check it before you make an edit (might be some namespacing error from my side instead). It wasn't working in my case and I got corrupt reads from the line that follows it.

Thanks anyways !