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

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

Open
globalizemeramesh opened this issue Nov 21, 2019 · 4 comments

Comments

@globalizemeramesh
Copy link

globalizemeramesh commented Nov 21, 2019

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.

@globalizemeramesh globalizemeramesh changed the title Error : To test StarGAN on CelebA: Error : To test StarGAN on CelebA: FileNotFoundError: [Errno 2] No such file or directory: 'stargan_celeba/models/200000-G.ckpt' Nov 21, 2019
@ctcook97
Copy link

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
Copy link
Author

globalizemeramesh commented Dec 2, 2019

  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
Copy link

ctcook97 commented Dec 3, 2019

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
Copy link
Author

globalizemeramesh commented Dec 3, 2019

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

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