Hair-synthesis-using-GAN
Hair-synthesis-using-GAN copied to clipboard
Error while loading weights!
Hi,
Thanks for sharing the great work. I'm getting this error:
module.load_state_dict(module_dict[name]) File "/home/anaconda3/envs/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1407, in load_state_dict self.__class__.__name__, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for MappingNetwork: Missing key(s) in state_dict: "unshared.2.0.weight", "unshared.2.0.bias", "unshared.2.2.weight", "unshared.2.2.bias", "unshared.2.4.weight", "unshared.2.4.bias", "unshared.2.6.weight", "unshared.2.6.bias", "unshared.3.0.weight", "unshared.3.0.bias", "unshared.3.2.weight", "unshared.3.2.bias", "unshared.3.4.weight", "unshared.3.4.bias", "unshared.3.6.weight", "unshared.3.6.bias", "unshared.4.0.weight", "unshared.4.0.bias", "unshared.4.2.weight", "unshared.4.2.bias", "unshared.4.4.weight", "unshared.4.4.bias", "unshared.4.6.weight", "unshared.4.6.bias", "unshared.5.0.weight", "unshared.5.0.bias", "unshared.5.2.weight", "unshared.5.2.bias", "unshared.5.4.weight", "unshared.5.4.bias", "unshared.5.6.weight", "unshared.5.6.bias", "unshared.6.0.weight", "unshared.6.0.bias", "unshared.6.2.weight", "unshared.6.2.bias", "unshared.6.4.weight", "unshared.6.4.bias", "unshared.6.6.weight", "unshared.6.6.bias".
Do you know how can I solve this error?
Thanks
Can I know what weight this is? I've never had a problem like this.
I also get the same error when I try to load the checkpoint:
Namespace(batch_size=32, checkpoint_dir='expr/checkpoints/celeba_hq', hidden_dim=512, img_size=256, latent_dim=16, mode='styling_rand', num_domains=7, num_outs_per_domain=3, num_workers=4, ref_dir='assets/representative/celeba_hq/ref', result_dir='expr/results/celeba_hq', resume_iter=100000, seed=777, src_dir='assets/representative/celeba_hq/src', style_dim=64, target_domain=0, w_hpf=1.0, wing_path='pretrained_network/StarGAN/wing.ckpt') Preparing DataLoader for the generation phase... Loading checkpoint from expr/checkpoints/celeba_hq/100000_nets_ema.ckpt... Traceback (most recent call last): File "main.py", line 72, in <module> main(args) File "main.py", line 28, in main make_img(args) File "/opt/home/projects/tools/Hair-synthesis-using-GAN/StarGAN_v2/test.py", line 35, in make_img solver.using_latent(loaders) File "/opt/home/projects/tools/Hair-synthesis-using-GAN/StarGAN_v2/core/solver.py", line 77, in using_latent self._load_checkpoint(args.resume_iter) File "/opt/home/projects/tools/Hair-synthesis-using-GAN/StarGAN_v2/core/solver.py", line 39, in _load_checkpoint ckptio.load(step) File "/opt/home/projects/tools/Hair-synthesis-using-GAN/StarGAN_v2/core/checkpoint.py", line 41, in load module.load_state_dict(module_dict[name]) File "/home/anaconda3/envs/hair_env/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1406, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for MappingNetwork: Missing key(s) in state_dict: "unshared.2.0.weight", "unshared.2.0.bias", "unshared.2.2.weight", "unshared.2.2.bias", "unshared.2.4.weight", "unshared.2.4.bias", "unshared.2.6.weight", "unshared.2.6.bias", "unshared.3.0.weight", "unshared.3.0.bias", "unshared.3.2.weight", "unshared.3.2.bias", "unshared.3.4.weight", "unshared.3.4.bias", "unshared.3.6.weight", "unshared.3.6.bias", "unshared.4.0.weight", "unshared.4.0.bias", "unshared.4.2.weight", "unshared.4.2.bias", "unshared.4.4.weight", "unshared.4.4.bias", "unshared.4.6.weight", "unshared.4.6.bias", "unshared.5.0.weight", "unshared.5.0.bias", "unshared.5.2.weight", "unshared.5.2.bias", "unshared.5.4.weight", "unshared.5.4.bias", "unshared.5.6.weight", "unshared.5.6.bias", "unshared.6.0.weight", "unshared.6.0.bias", "unshared.6.2.weight", "unshared.6.2.bias", "unshared.6.4.weight", "unshared.6.4.bias", "unshared.6.6.weight", "unshared.6.6.bias".
Can you open up the model? I have this problem, too