pix2pixHD icon indicating copy to clipboard operation
pix2pixHD copied to clipboard

Pretrained model has fewer layers than actual model

Open smit-r opened this issue 4 years ago • 5 comments

I trained the model on custom data and when I tested it, the results are not very good and it shows the following message: Pretrained network G has fewer layers; The following are not initialized: ['model1_1', 'model1_2']

smit-r avatar Apr 28 '20 11:04 smit-r

facing the same problem, did anybody know how to solve it

afaq-ahmad avatar Jul 24 '20 16:07 afaq-ahmad

Just ensure that you set --netG parameter same in training and testing scripts While training I had put --netG local and I used default value of --netG which was different

smit-r avatar Jul 25 '20 04:07 smit-r

If --netG is same, check that --ngf and --nef parameters are same while training and testing

smit-r avatar Jul 25 '20 04:07 smit-r

So i was using 2 n_local_enhancers after adding this option in test.py file like this solved the problem opt.n_local_enhancers=2

Thanks

afaq-ahmad avatar Jul 25 '20 19:07 afaq-ahmad

I fixed the same issue in mine by correcting the --ngf value in testing script. It should match with the one during training.

Akshace avatar Jul 08 '21 19:07 Akshace