You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to use your .py files and saved weights to load your pre-trained model. But there's a few problems.
If I understand corretly, I am supposed to download/use these weights 'exps/autogan_cifar10_a.sh', and use the associated .py file.
I used the following info
python test.py
--dataset cifar10
--img_size 32
--bottom_width 4
--gen_model autogan_cifar10_a
--latent_dim 128
--gf_dim 256
--g_spectral_norm False
--load_path /path/to/*.pth
--exp_name test_autogan_cifar10_a
...and put it manually into the autogan_cifar10_a.py file. But I get the following error when I try load the weights into the class.
/anaconda3/envs/exp1/lib/python3.6/site-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict)
775 if len(error_msgs) > 0:
776 raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
--> 777 self.class.name, "\n\t".join(error_msgs)))
778 return _IncompatibleKeys(missing_keys, unexpected_keys)
779
RuntimeError: Error(s) in loading state_dict for Generator:
Missing key(s) in state_dict: "cell1.n1.weight", "cell1.n1.bias", "cell1.n1.running_mean", "cell1.n1.running_var", "cell1.n2.weight", "cell1.n2.bias", "cell1.n2.running_mean", "cell1.n2.running_var".
`
Thank you in advance for any help, perhaps you could provide a working example where you load the pre-trained model and generate some samples in a jupyter notebook? Happy new year :-)
The text was updated successfully, but these errors were encountered:
Hi, thanks for supplying this repo.
I've been trying to use your .py files and saved weights to load your pre-trained model. But there's a few problems.
If I understand corretly, I am supposed to download/use these weights 'exps/autogan_cifar10_a.sh', and use the associated .py file.
I used the following info
python test.py
--dataset cifar10
--img_size 32
--bottom_width 4
--gen_model autogan_cifar10_a
--latent_dim 128
--gf_dim 256
--g_spectral_norm False
--load_path /path/to/*.pth
--exp_name test_autogan_cifar10_a
...and put it manually into the autogan_cifar10_a.py file. But I get the following error when I try load the weights into the class.
`---> 52 G.load_state_dict(torch.load('weights/autogan_cifar10_a.pth', map_location='cpu'))
53 cnn.load_state_dict(torch.load('weights/cifar-10_cnn Resnet.pth', map_location='cpu'))
54
/anaconda3/envs/exp1/lib/python3.6/site-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict)
775 if len(error_msgs) > 0:
776 raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
--> 777 self.class.name, "\n\t".join(error_msgs)))
778 return _IncompatibleKeys(missing_keys, unexpected_keys)
779
RuntimeError: Error(s) in loading state_dict for Generator:
Missing key(s) in state_dict: "cell1.n1.weight", "cell1.n1.bias", "cell1.n1.running_mean", "cell1.n1.running_var", "cell1.n2.weight", "cell1.n2.bias", "cell1.n2.running_mean", "cell1.n2.running_var".
`
Thank you in advance for any help, perhaps you could provide a working example where you load the pre-trained model and generate some samples in a jupyter notebook? Happy new year :-)
The text was updated successfully, but these errors were encountered: