Closed Dian-Yi closed 3 years ago
因为op是StyleGAN2的模块,要先按照stylegan2-pytorch配置StyleGAN2的环境,因为包含gcc,cuda版本兼容的问题,需要你在自己的服务器上配置。
As stated in README.md, you need to implement StyleGAN2 as a prerequisite, including gcc compiler. Please refer stylegan2-pytorch for details.
If possible, please write down how to run the code in detail, thank you.
python inference.py \
--swap_type [ftm/injection/lcr] \
--img_root [CelebAHQ-PATH] \
--mask_root [CelebAMaskHQ-PATH] \
--srcID [INT-NUMBER] \
--tgtID [INT-NUMBER]
where swap_type means which face transfer module you use, img_root is the CelebAHQ path, mask_root is the CelebAMaskHQ path, srcID and tgtID represent the image number of the CelebAHQ dataset.
And you need to download the pretrained weights:
Baidu Cloud (access code: 7nov)
I have downloaded these models.
If you have followed all steps above, you should be able to use the inference code.
If No module named 'op'
is your problem, then you didn't follow the instructions of stylegan2-pytorch correctly.
Actually, step 1 is the most difficult step for users, as you need to compile .cu
files by yourself.
Hi, would you like to explain more details of step one, especially compile .cu files?
Well, you can follow these steps:
git clone https://github.com/zyainfal/stylegan2-pytorch.git
cd stylegan2-pytorch
and test if you can convert weight from official checkpoints
or generate samples
(if you can, then everything you need to do for stylegan2 environment is done)For compile .cu
files, stylegan2-pytorch
has done for you (if you have right gcc and cuda version).
Sorry for bothering you again. I was able to make the procedure you mentioned in the bulleted list above (both converting the checkpoint and generate samples correctly) but it still gives the error "No module named 'op'". Nevertheless, when I run the command from stylegan2-pytorch python stylegan2-pytorch/convert_weight.py --repo stylegan2/ stylegan2-ffhq-config-f.pkl I can see the following output: Setting up TensorFlow plugin "fused_bias_act.cu": Preprocessing... Loading... Done. Setting up TensorFlow plugin "upfirdn_2d.cu": Preprocessing... Loading... Done.
Can you help me with this issue, please? Thanks.
Do you put my codes under stylegan2-pytorch directory?
Ok, now it works. Thanks.
Great!
We are all chinese people, i describe the problem using chinese for convenience. 非常感谢你的工作,我测试你的inference demo 发现缺少一些函数。希望你能够将inference的demo运行完整。 谢谢。