naoto0804 / pytorch-AdaIN

Unofficial pytorch implementation of 'Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization' [Huang+, ICCV2017]
MIT License
1.08k stars 208 forks source link

How to train a new style #44

Closed wjjjjyourFA closed 3 years ago

wjjjjyourFA commented 3 years ago

Hi. I wonder how to train a new style.

I put a image in ./input/content and another in ./input/style, using "vgg_normalized.pth" CMD:python train.py --content_dir input/content --style_dir input/style --batch_size 4 --max_iter 160 Though I got a xx.pth.tar in ./experiments, I use it "test.py", getting a gray image result.

source src Image-001628821383431

result src Image-001628821383431_stylized_004778408333303

naoto0804 commented 3 years ago

I guess max_iter is too small. Please try the default parameters, or keep an eye on the convergence of loss curves to make sure you train the model enough.