StelaBou / stylegan_directions_face_reenactment

Authors official PyTorch implementation of the "Finding Directions in GAN’s Latent Space for Neural Face Reenactment" [BMVC 2022].
50 stars 5 forks source link

Incorrect path found in the config_models.py file for both FFHQ models #2

Closed dedkamaroz closed 1 year ago

dedkamaroz commented 1 year ago

https://github.com/StelaBou/stylegan_directions_face_reenactment/blame/33a1f141c41de6fd740d2c313c5ffa476f997d94/libs/configs/config_models.py#L19

The following path is in the file for both FFHQ entries:

'/home/stella/Desktop/projects/Finding_Directions_Reenactment/pretrained_models/stylegan2-ffhq-config-f_1024.pt'

I assume it should be: './pretrained_models/stylegan2-ffhq-config-f_1024.pt'


This results in the following error stack:

----- Load generator from /home/stella/Desktop/projects/Finding_Directions_Reenactment/pretrained_models/stylegan2-ffhq-config-f_1024.pt ----- Traceback (most recent call last): File "run_facial_editing.py", line 315, in inference.run_editing() File "run_facial_editing.py", line 217, in run_editing self.load_models(inversion) File "run_facial_editing.py", line 74, in load_models self.generator.load_state_dict(torch.load(self.gan_weights)['g_ema'], strict = True) File "/home/ubuntu/miniconda3/envs/python38/lib/python3.8/site-packages/torch/serialization.py", line 581, in load with _open_file_like(f, 'rb') as opened_file: File "/home/ubuntu/miniconda3/envs/python38/lib/python3.8/site-packages/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/home/ubuntu/miniconda3/envs/python38/lib/python3.8/site-packages/torch/serialization.py", line 211, in init super(_open_file, self).init(open(name, mode)) FileNotFoundError: [Errno 2] No such file or directory: '/home/stella/Desktop/projects/Finding_Directions_Reenactment/pretrained_models/stylegan2-ffhq-config-f_1024.pt'


If I replace the error line with the path I assumed is correct, download this model file, append "_1024" to the end of the file name and place the file in the './pretrained_models/' folder; I can then run 'run_facial_editing.py' and this model is loaded successfully.

Unfortunately another error comes up (I will raise another issue record). Thank you

StelaBou commented 1 year ago

Yes that's right, thank you. I will update the config script.