yunjey / stargan

StarGAN - Official PyTorch Implementation (CVPR 2018)
MIT License
5.23k stars 973 forks source link

Error : To test StarGAN on CelebA: FileNotFoundError: [Errno 2] No such file or directory: 'stargan_celeba/models/200000-G.ckpt' #110

Open globalizemeramesh opened 5 years ago

globalizemeramesh commented 5 years ago

The number of parameters: 44762048 Loading the trained models from step 200000... Traceback (most recent call last): File "main.py", line 110, in main(config) File "main.py", line 49, in main solver.test() File "/home/ubuntu/prachi/StarGAN/solver.py", line 526, in test self.restore_model(self.test_iters) File "/home/ubuntu/prachi/StarGAN/solver.py", line 103, in restore_model self.G.load_state_dict(torch.load(G_path, map_location=lambda storage, loc: storage)) File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/torch/serialization.py", line 381, in load f = open(f, 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'stargan_celeba/models/200000-G.ckpt'

I AM NEW TO THIS. I have queries too.

  1. I have stargan_celeba/models folder but 200000-G.ckpt file missing. How do i get this file? And if i am working on my own data set images, then can i use the same .ckpt file?
  2. I also came across attr_celeba.txt file now my doubt is if i use my own personal image dataset then how do to create my own attr_celeba.txt file? Is that created manually one by one?

Thanks in advance.

ctcook97 commented 5 years ago

200000-G.ckpt is the model. If you are just wanting to change hair colors and stuff, you can download the pretrained one. Otherwise you're going to have to make it by training it yourself - see the instructions on how to do that in the readme

globalizemeramesh commented 5 years ago
  1. My understanding says if we train the model say for example $ python main.py --mode train --dataset CelebA --image_size 128 --c_dim 5 \ --sample_dir stargan_celeba/samples --log_dir stargan_celeba/logs \ --model_save_dir stargan_celeba/models --result_dir stargan_celeba/results \ --selected_attrs Black_Hair Blond_Hair Brown_Hair Male Young the .ckpt will be automatically generated?

2. What is attr_celeba.txt file? How do we get this file?

ctcook97 commented 5 years ago

Did you train it for long enough? The model only saves every 5k iterations by default I believe but that's also an argument you can pass in

And I thought it just got downloaded with the rest

globalizemeramesh commented 5 years ago

Yes i have trained it completely on AWS but the file is not generated. And when i test i get the above error