Comments (8)
You still need to run Facial Destylization, since we need to prepare paired training data to train DualStyleGAN (i.e., need to obtain the intrinsic and extrinsic style codes).
Then, in Progressive Fine-Tuning, you can skip step 1 & 2 by loading my pretrained model, and only run step 3.
from dualstylegan.
Thanks for answering it!
So does it mean I can skip step2 in facial destylization but need to do step 3? Or should I do both?
from dualstylegan.
You can try with or without step 2.
I don't know which one is better.
from dualstylegan.
Thanks!
I tried to train step2 in Facial Destylization, but faced an error.
I prepared 300 images with alignment and super resolution script, 1024x1024, and saved them in /data/mystyle/images/train
and then run this command
python ./model/stylegan/prepare_data.py --out ./data/mystyle/lmdb/ --n_worker 4 --size 1024 ./data/mystyle/images/
It created two files in lmdb folder which are data.mdb and lock.mdb.
and run this command,
python -m torch.distributed.launch --nproc_per_node=1 --master_port=8765 finetune_stylegan.py --iter 600 --batch 4 --ckpt ./checkpoint/stylegan2-ffhq-config-f.pt --style mystyle --augment ./data/mystyle/lmdb/
but faced this error. Could you point out what I am wrong here?
I am using RTX A5000 GPU 24G VRAM
load model: ./checkpoint/stylegan2-ffhq-config-f.pt
0%| | 0/600 [00:00<?, ?it/s]/home/donghyun/Desktop/training/DualStyleGAN/model/stylegan/op/conv2d_gradfix.py:88: UserWarning: conv2d_gradfix not supported on PyTorch 1.12.1+cu113. Falling back to torch.nn.functional.conv2d().
warnings.warn(
0%| | 0/600 [00:01<?, ?it/s]
Traceback (most recent call last):
File "finetune_stylegan.py", line 391, in
train(args, loader, generator, discriminator, g_optim, d_optim, g_ema, device)
File "finetune_stylegan.py", line 159, in train
r1_loss = d_r1_loss(real_pred, real_img)
File "/home/donghyun/Desktop/training/DualStyleGAN/util.py", line 71, in d_r1_loss
grad_real, = autograd.grad(
File "/home/donghyun/anaconda3/envs/dualstylegan_env/lib/python3.8/site-packages/torch/autograd/init.py", line 276, in grad
return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
File "/home/donghyun/anaconda3/envs/dualstylegan_env/lib/python3.8/site-packages/torch/autograd/function.py", line 253, in apply
return user_fn(self, *args)
File "/home/donghyun/Desktop/training/DualStyleGAN/model/stylegan/non_leaking.py", line 352, in backward
grad_input, grad_grid = GridSampleBackward.apply(grad_output, input, grid)
File "/home/donghyun/Desktop/training/DualStyleGAN/model/stylegan/non_leaking.py", line 361, in forward
grad_input, grad_grid = op(grad_output, input, grid, 0, 0, False)
TypeError: 'tuple' object is not callable
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 17115) of binary: /home/donghyun/anaconda3/envs/dualstylegan_env/bin/python
Traceback (most recent call last):
File "/home/donghyun/anaconda3/envs/dualstylegan_env/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/donghyun/anaconda3/envs/dualstylegan_env/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/donghyun/anaconda3/envs/dualstylegan_env/lib/python3.8/site-packages/torch/distributed/launch.py", line 193, in
main()
File "/home/donghyun/anaconda3/envs/dualstylegan_env/lib/python3.8/site-packages/torch/distributed/launch.py", line 189, in main
launch(args)
File "/home/donghyun/anaconda3/envs/dualstylegan_env/lib/python3.8/site-packages/torch/distributed/launch.py", line 174, in launch
run(args)
File "/home/donghyun/anaconda3/envs/dualstylegan_env/lib/python3.8/site-packages/torch/distributed/run.py", line 752, in run
elastic_launch(
File "/home/donghyun/anaconda3/envs/dualstylegan_env/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 131, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/home/donghyun/anaconda3/envs/dualstylegan_env/lib/python3.8/site-packages/torch/distributed/launcher/api.py", line 245, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:
finetune_stylegan.py FAILED
Failures:
<NO_OTHER_FAILURES>
Root Cause (first observed failure):
[0]:
time : 2022-11-11_01:36:27
host : kr-03
rank : 0 (local_rank: 0)
from dualstylegan.
https://github.com/williamyang1991/DualStyleGAN/tree/main/model/stylegan/op_cpu
you can change to CPU compatible version to avoid using conv2d_gradfix.py
from dualstylegan.
conv2d_gradfix.py is from stylegan2-pytorch, or you can check similar issues in
https://github.com/rosinality/stylegan2-pytorch/issues
to see if there are any solution
from dualstylegan.
I see. I thought this is because of the multi GPU setting.
I wonder about your training process when creating different models such as cartoon or Pixar.
Did you train all the models from Facial Destylization to optimization? or skip step 2 in Facial Destylization or any other steps?
from dualstylegan.
all process
only skip Progressive Fine-Tuning step 1 & 2 by loading the pretrained model
from dualstylegan.
Related Issues (20)
- 为什么重建的人脸跟以前相差很多呢? HOT 1
- RuntimeError: CUDA error: no kernel image is available for execution on the device
- How to change weights for getting better results of style transformation ? HOT 2
- How to make toon image ,Instead of changing style transformation of original Image ? HOT 2
- 我想使用生成的风格图像进行风格迁移,应该如何操作呢? HOT 1
- Why " W+ " encoder giving fully different style transformation ? HOT 23
- How to use this code in mac OS and building in IOS Device ? HOT 1
- 卡通化的人物可以保留人物的真实感吗? HOT 1
- Why dose the destylization process work? HOT 3
- 灌篮高手风格模型 HOT 1
- """Add --wplus in style_transfer.py to use original w+ pSp encoder rather than z+.""" integrate in demo of Hf spaces HOT 3
- Toon images HOT 2
- integrate stable diffusion pretrained models
- How is this picture drawn? HOT 1
- Memory issue while toonifying the image using "VToonify" but not while style transfering the image using "DualStyleGAN" why ?
- AttributeError: module 'model.stylegan' has no attribute 'lpips' HOT 1
- RuntimeError: mat1 dim 1 must match mat2 dim 0 HOT 1
- RuntimeError: input must be contiguous HOT 2
- pre-train ConditionalDiscriminator HOT 1
- 生成图片的脖子有痕迹 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dualstylegan.