1. 程式人生 > >TF之DCGAN:基於TF利用DCGAN測試自己的資料集並進行生成過程全記錄

TF之DCGAN:基於TF利用DCGAN測試自己的資料集並進行生成過程全記錄

訓練的資料集部分圖片

以從網上收集了許多日式動畫為例

訓練過程全記錄

開始訓練……
{'batch_size': <absl.flags._flag.Flag object at 0x000002C943CD16A0>,
 'beta1': <absl.flags._flag.Flag object at 0x000002C9463D5F60>,
 'checkpoint_dir': <absl.flags._flag.Flag object at 0x000002C946422CC0>,
 'crop': <absl.flags._flag.BooleanFlag object at 0x000002C946422E10>,
 'dataset': <absl.flags._flag.Flag object at 0x000002C946422BA8>,
 'epoch': <absl.flags._flag.Flag object at 0x000002C93CA90320>,
 'h': <tensorflow.python.platform.app._HelpFlag object at 0x000002C946422EF0>,
 'help': <tensorflow.python.platform.app._HelpFlag object at 0x000002C946422EF0>,
 'helpfull': <tensorflow.python.platform.app._HelpfullFlag object at 0x000002C946422F60>,
 'helpshort': <tensorflow.python.platform.app._HelpshortFlag object at 0x000002C946422FD0>,
 'input_fname_pattern': <absl.flags._flag.Flag object at 0x000002C946422C18>,
 'input_height': <absl.flags._flag.Flag object at 0x000002C943CD1B38>,
 'input_width': <absl.flags._flag.Flag object at 0x000002C946422A20>,
 'learning_rate': <absl.flags._flag.Flag object at 0x000002C93E5E7DA0>,
 'output_height': <absl.flags._flag.Flag object at 0x000002C946422A90>,
 'output_width': <absl.flags._flag.Flag object at 0x000002C946422B38>,
 'sample_dir': <absl.flags._flag.Flag object at 0x000002C946422D30>,
 'train': <absl.flags._flag.BooleanFlag object at 0x000002C946422D68>,
 'train_size': <absl.flags._flag.Flag object at 0x000002C943CD10F0>,
 'visualize': <absl.flags._flag.BooleanFlag object at 0x000002C946422E80>}
2018-10-06 15:18:41.635062: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
---------
Variables: name (type shape) [size]
---------
generator/g_h0_lin/Matrix:0 (float32_ref 100x4608) [460800, bytes: 1843200]
generator/g_h0_lin/bias:0 (float32_ref 4608) [4608, bytes: 18432]
generator/g_bn0/beta:0 (float32_ref 512) [512, bytes: 2048]
generator/g_bn0/gamma:0 (float32_ref 512) [512, bytes: 2048]
generator/g_h1/w:0 (float32_ref 5x5x256x512) [3276800, bytes: 13107200]
generator/g_h1/biases:0 (float32_ref 256) [256, bytes: 1024]
generator/g_bn1/beta:0 (float32_ref 256) [256, bytes: 1024]
generator/g_bn1/gamma:0 (float32_ref 256) [256, bytes: 1024]
generator/g_h2/w:0 (float32_ref 5x5x128x256) [819200, bytes: 3276800]
generator/g_h2/biases:0 (float32_ref 128) [128, bytes: 512]
generator/g_bn2/beta:0 (float32_ref 128) [128, bytes: 512]
generator/g_bn2/gamma:0 (float32_ref 128) [128, bytes: 512]
generator/g_h3/w:0 (float32_ref 5x5x64x128) [204800, bytes: 819200]
generator/g_h3/biases:0 (float32_ref 64) [64, bytes: 256]
generator/g_bn3/beta:0 (float32_ref 64) [64, bytes: 256]
generator/g_bn3/gamma:0 (float32_ref 64) [64, bytes: 256]
generator/g_h4/w:0 (float32_ref 5x5x3x64) [4800, bytes: 19200]
generator/g_h4/biases:0 (float32_ref 3) [3, bytes: 12]
discriminator/d_h0_conv/w:0 (float32_ref 5x5x3x64) [4800, bytes: 19200]
discriminator/d_h0_conv/biases:0 (float32_ref 64) [64, bytes: 256]
discriminator/d_h1_conv/w:0 (float32_ref 5x5x64x128) [204800, bytes: 819200]
discriminator/d_h1_conv/biases:0 (float32_ref 128) [128, bytes: 512]
discriminator/d_bn1/beta:0 (float32_ref 128) [128, bytes: 512]
discriminator/d_bn1/gamma:0 (float32_ref 128) [128, bytes: 512]
discriminator/d_h2_conv/w:0 (float32_ref 5x5x128x256) [819200, bytes: 3276800]
discriminator/d_h2_conv/biases:0 (float32_ref 256) [256, bytes: 1024]
discriminator/d_bn2/beta:0 (float32_ref 256) [256, bytes: 1024]
discriminator/d_bn2/gamma:0 (float32_ref 256) [256, bytes: 1024]
discriminator/d_h3_conv/w:0 (float32_ref 5x5x256x512) [3276800, bytes: 13107200]
discriminator/d_h3_conv/biases:0 (float32_ref 512) [512, bytes: 2048]
discriminator/d_bn3/beta:0 (float32_ref 512) [512, bytes: 2048]
discriminator/d_bn3/gamma:0 (float32_ref 512) [512, bytes: 2048]
discriminator/d_h4_lin/Matrix:0 (float32_ref 4608x1) [4608, bytes: 18432]
discriminator/d_h4_lin/bias:0 (float32_ref 1) [1, bytes: 4]
Total size of variables: 9086340
Total bytes of variables: 36345360

 [*] Reading checkpoints...
 [*] Failed to find a checkpoint
 [!] Load failed...
Epoch: [ 0] [   0/ 800] time: 14.9779, d_loss: 5.05348301, g_loss: 0.00766894
Epoch: [ 0] [   1/ 800] time: 28.0542, d_loss: 4.82881641, g_loss: 0.01297333
Epoch: [ 0] [   2/ 800] time: 40.2559, d_loss: 3.48951864, g_loss: 0.07677600
Epoch: [ 0] [   3/ 800] time: 53.2987, d_loss: 4.46177912, g_loss: 0.01912572
Epoch: [ 0] [   4/ 800] time: 66.6449, d_loss: 3.76898527, g_loss: 0.06732680
Epoch: [ 0] [   5/ 800] time: 80.2566, d_loss: 3.12670279, g_loss: 0.12792118
Epoch: [ 0] [   6/ 800] time: 94.6307, d_loss: 3.61706448, g_loss: 0.05859204
Epoch: [ 0] [   7/ 800] time: 108.9309, d_loss: 2.67836666, g_loss: 0.26883626
Epoch: [ 0] [   8/ 800] time: 122.1341, d_loss: 3.90734839, g_loss: 0.05641707
Epoch: [ 0] [   9/ 800] time: 135.7154, d_loss: 1.87382483, g_loss: 1.13096261
Epoch: [ 0] [  10/ 800] time: 148.9689, d_loss: 6.14149714, g_loss: 0.00330601
Epoch: [ 0] [  11/ 800] time: 162.9731, d_loss: 1.50024509, g_loss: 0.68656492

……

Epoch: [ 0] [  68/ 800] time: 994.1418, d_loss: 2.03141069, g_loss: 0.48166284
Epoch: [ 0] [  69/ 800] time: 1010.7305, d_loss: 1.68912172, g_loss: 0.54282755
Epoch: [ 0] [  70/ 800] time: 1025.8396, d_loss: 1.57041526, g_loss: 0.60873854