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

karras2019stylegan-ffhq-1024x1024.pt #18

Open
zmxhhh opened this issue Dec 27, 2021 · 5 comments
Open

karras2019stylegan-ffhq-1024x1024.pt #18

zmxhhh opened this issue Dec 27, 2021 · 5 comments

Comments

@zmxhhh
Copy link

zmxhhh commented Dec 27, 2021

Can anyone share weight files? The link provided by the author cannot be downloaded at this time.

@pacifinapacific
Copy link
Owner

pacifinapacific commented Dec 27, 2021

You can download the official styleGAN weights at this time. You can find stylegan-ffhq-1024x1024.pkl in the Resource section of the README below.
https://github.com/NVlabs/stylegan
or
https://drive.google.com/uc?id=1MEGjdvVpUsu1jB4zrXZN7Y4kBBOzizDQ

If you can't use google drive, I can't help you because the way I provide it is also google drive. Sorry about that.

@zmxhhh
Copy link
Author

zmxhhh commented Dec 27, 2021

Thank you very much for your reply. I've got the file. The weight_convert.py file frequently displays “no attribute ‘XXX’“ errors, so I want to know which version of your TensorFlow is? Does expression transfer correspond to facial_exchange.py file? Thanks again for your reply.

@pacifinapacific
Copy link
Owner

The environment at the time of development has been discarded, but it should be possible to convert it using tensorflow-gpu==1.15. 
The paper "Unconstrained Facial Expression Transfer using Style-based Generator" corresponds to facial_exchange.py.

@zmxhhh
Copy link
Author

zmxhhh commented Dec 30, 2021

Thank you very much for your answer. I encountered the following problem when running the facial_exchange.py file. The problem is with the line "loss_2.Backward ()". After querying, it is found that if the "optimizer.step()" after "loss_1.backward ()" is removed, it can run normally, so does removing this line have any effect? Is the result still correct?In addition, what are the meanings of the four folders of program running results: a, e, result1 and result2 respectively? I am very sorry that I did not observe the corresponding relationship in the result, so I ask you for help. I am looking forward to your reply.
Here is the output and errors from when I ran your original program:
Start
iter0: loss0 --6.6923747062683105, loss1 --5.94498374084651e-07
Traceback (most recent call last):
File "facial_exchange.py", line 194, in
main()
File "facial_exchange.py", line 88, in main
loss_2.backward()
File "/home/cqupt1811/anaconda3/lib/python3.7/site-packages/torch/tensor.py", line 221, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/cqupt1811/anaconda3/lib/python3.7/site-packages/torch/autograd/init.py", line 132, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1, 512]], which is output 0 of SelectBackward, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

@pacifinapacific
Copy link
Owner

Hmmm. Maybe it's the version of pyotrch. I'm sorry but I can't experiment right away in my environment. is it possible to try with an older version such as pytoch 1.4.0?
The folder a and e are the optimized images for the appearance and expression images respectively, and the result1 and result2 are the resulting images when the appearance and expression are swapped.

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