CompVis / adaptive-style-transfer

source code for the ECCV18 paper A Style-Aware Content Loss for Real-time HD Style Transfer
https://compvis.github.io/adaptive-style-transfer/
GNU General Public License v3.0
723 stars 139 forks source link

training a new model gives bad style output #23

Closed me88 closed 5 years ago

me88 commented 5 years ago

I try to train a Leonid Afremov style. [check on Google to see his particular style of painting vivid color paintings with knife instead of brush...]

I have 47 training style image each input is roughly about 500kB . Here is an overview of the training sample : https://ibb.co/y8nVrxF And of course I downloaded the 112GB training large place sample.

Even after many steps I still do not recognize the style of Afremov even at 75% of the training phase. The results do not look like Afremov style.

For instance:

Step_224500.jpg https://ibb.co/H7h96Vf

Step_223500.jpg https://ibb.co/8NLcH1h

Here is how I run the training model:

#!/bin/sh
CUDA_VISIBLE_DEVICES=0 python main.py \
                 --model_name=model_Afremov_new \
                 --batch_size=1 \
                 --phase=train \
                 --image_size=768 \
                 --lr=0.0002 \
                 --dsr=0.8 \
                 --ptcd=/<myOwnPath>/data_large \
                 --ptad=./data/art_afremov

Does someone has any recommendation to give me?

asanakoy commented 5 years ago

Have you trained with 768x768 images or 1400x1400?

asanakoy commented 5 years ago

Make sure that the patches cropped from the style images have approximately the same scale. Try training more iterations. Changing dsr might also help.
Another thing to try is to train with the larger batch size, but with smaller patches.

me88 commented 5 years ago

Have you trained with 768x768 images or 1400x1400?

I do not understand your question. Do you mean the size of the train image should be similar?(A) Or do you ask me which "image_size" param I used for the training ? (B)

A. I just unzip the 112GB image provided. I havent check the size of the image and the Afremov styles images (https://ibb.co/y8nVrxF) are all of various size! Do they need to be all the same size ???

B. As you see on the code I posted, the parameter is: --image_size=768

me88 commented 5 years ago

Try training more iterations. Changing dsr might also help.

Which dsr should I use [I currently use 0.8]. Should I increase or decrease?

Make sure that the patches cropped from the style images have approximately the same scale.

Do you mean that my Afremov style images (https://ibb.co/y8nVrxF) should have the same about the same scale? If not, what do you mean?

Another thing to try is to train with the larger batch size, but with smaller patches.

What do you mean by smaller patches?

asanakoy commented 5 years ago

Which dsr should I use [I currently use 0.8]. Should I increase or decrease? This is a hyper-parameter, try setting it +- 0.1. You can also remove dsr part at all and always make one step of generator and one step of discriminator.

Do you mean that my Afremov style images (https://ibb.co/y8nVrxF) should have the same about the same scale? If not, what do you mean? Yes.

What do you mean by smaller patches? Crop smaller patches from you style and content images. Size of the training patch is defined by --image_size=

Perhaps, you didn't train long enough, till the convergence.