Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing Error #114

Open
kanlions opened this issue Dec 16, 2019 · 3 comments
Open

Testing Error #114

kanlions opened this issue Dec 16, 2019 · 3 comments

Comments

@kanlions
Copy link

I trained on a custom dataset with the directory structure mentioned. The training was successful,
Now I am getting this issue while testing

Error(s) in loading state_dict for Generator:
size mismatch for main.0.weight: copying a param with shape torch.Size([64, 8, 7, 7]) from checkpoint, the shape in current model is torch.Size([64, 5, 7, 7])

Well the dataset is same only test and train images are different

@yunjey
Copy link
Owner

yunjey commented Dec 16, 2019

@kanlions Set the argument --c_dim to 8 when testing. The error message shows that you set --c_dim = 8 at training time but --c_dim = 5 at testing time.

@kanlions
Copy link
Author

Thank you the author for immediate clarification. While training I used less number of classes and put c_dim as the number of classes not 8. I am not working with face images as your problem. The end goal will be image to multi image translation under different weather conditions. I intend to use natural architectures not faces. I have followed instructions as RaFD directory structure, for beginning I want to have 3 classes and number of classes will increase when we get more data. with c_dim = 3 how did I landup with 8 classes as I executed the following and also RafD train directory has 3 folders only (low med high)
python main.py --mode train --dataset RaFD --image_size 256 --c_dim 3 --rafd_image_dir /home/user1/Desktop/GANS/stargan-master/jpg/data/RaFD/test --sample_dir stargan_custom/samples --log_dir stargan_custom/logs --model_save_dir stargan_custom/models --result_dir stargan_custom/results

@yunjey
Copy link
Owner

yunjey commented Dec 19, 2019

@kanlions If the number of classes is 3, set the argument --c_dim = 3 at training time. The argument setting of c_dim must be same at training and test time. As the number of classes increases (or decreases), you should retrain the model from scratch.

The RaFD dataset contains 8 classes/expressions i.e., neutral, angry, fearful, happy, sad, surprised, contemptuous, disgusted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants