TachibanaYoshino / AnimeGAN

A Tensorflow implementation of AnimeGAN for fast photo animation ! This is the Open source of the paper 「AnimeGAN: a novel lightweight GAN for photo animation」, which uses the GAN framwork to transform real-world photos into anime images.
4.49k stars 660 forks source link

g_loss is very high #36

Closed dragen1860 closed 4 years ago

dragen1860 commented 4 years ago

Dear author: thanks for sharing this greate repo. it's helpful! During reproduce your exp, i noticed the d&g loss is like this:

Epoch: 108 Step:   456  time: 0.595382 s d_loss: 11.78779125, g_loss: 1069.37170410 -- mean_d_loss: 15.22266197, mean_g_loss: 1128.97387695
Epoch: 108 Step:   457  time: 0.598991 s d_loss: 21.59355354, g_loss: 1145.24707031 -- mean_d_loss: 15.33250523, mean_g_loss: 1129.25439453
Epoch: 108 Step:   458  time: 0.592521 s d_loss: 6.78862953, g_loss: 1130.46630859 -- mean_d_loss: 15.18769360, mean_g_loss: 1129.27490234
Epoch: 108 Step:   459  time: 0.594440 s d_loss: 1.89800203, g_loss: 1081.30371094 -- mean_d_loss: 14.96619892, mean_g_loss: 1128.47534180
Epoch: 108 Step:   460  time: 0.595921 s d_loss: 65.07347870, g_loss: 1352.42736816 -- mean_d_loss: 15.78763008, mean_g_loss: 1132.14672852
Epoch: 108 Step:   461  time: 0.595723 s d_loss: 60.10780716, g_loss: 1378.10986328 -- mean_d_loss: 16.50247002, mean_g_loss: 1136.11389160
Epoch: 108 Step:   462  time: 0.596035 s d_loss: 2.82108736, g_loss: 1654.43518066 -- mean_d_loss: 16.28530502, mean_g_loss: 1144.34130859
Epoch: 108 Step:   463  time: 0.595019 s d_loss: 2.04391837, g_loss: 857.95996094 -- mean_d_loss: 16.06278419, mean_g_loss: 1139.86657715
Epoch: 108 Step:   464  time: 0.596555 s d_loss: 10.40408993, g_loss: 1090.06201172 -- mean_d_loss: 15.97572708, mean_g_loss: 1139.10034180
Epoch: 108 Step:   465  time: 0.595400 s d_loss: 7.73724365, g_loss: 965.87994385 -- mean_d_loss: 15.85090065, mean_g_loss: 1136.47583008

The g_loss is relatively large and does not decrease steadily. Is this normal? what's your training process looks like? thank you.

TachibanaYoshino commented 4 years ago

The loss of the generator includes the loss of style and the loss of content. The source of these two losses is the feature calculation of vgg19, so its value will be relatively large. You should pay more attention to the effect on the verification set after each epoch.