DCGAN-checkpoint.ipynb
36.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"import os\n",
"from glob import glob\n",
"import numpy as np\n",
"from matplotlib import pyplot\n",
"from PIL import Image\n",
"import tensorflow as tf\n",
"\n",
"##README : IF output folder already existed in same route, it makes error. change past output folder's name ##"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"class Dataset(object):\n",
" def __init__(self, data_files):\n",
" IMAGE_WIDTH = 25\n",
" IMAGE_HEIGHT = 25\n",
" self.image_mode = 'RGB'\n",
" image_channels = 3\n",
" self.data_files = data_files\n",
" self.shape = len(data_files), IMAGE_WIDTH, IMAGE_HEIGHT, image_channels\n",
" \n",
" def get_image(iself,image_path, width, height, mode):\n",
" image = Image.open(image_path)\n",
" image = image.resize((width,height))\n",
" return np.array(image)\n",
"\n",
"\n",
" def get_batch(self,image_files, width, height, mode):\n",
" data_batch = np.array(\n",
" [self.get_image(sample_file, width, height, mode) for sample_file in image_files]).astype(np.float32)\n",
" \n",
" # Make sure the images are in 4 dimensions\n",
" if len(data_batch.shape) < 4:\n",
" data_batch = data_batch.reshape(data_batch.shape + (1,))\n",
" return data_batch\n",
"\n",
" def get_batches(self, batch_size):\n",
" IMAGE_MAX_VALUE = 255\n",
" current_index = 0\n",
" while current_index + batch_size <= self.shape[0]:\n",
" data_batch = self.get_batch(\n",
" self.data_files[current_index:current_index + batch_size],\n",
" self.shape[1],self.shape[2],\n",
" self.image_mode)\n",
" \n",
" current_index += batch_size\n",
" \n",
" yield data_batch / IMAGE_MAX_VALUE - 0.5\n",
"\n",
"\n",
"def model_inputs(image_width, image_height, image_channels, z_dim):\n",
" real_input_images = tf.placeholder(tf.float32, [None, image_width, image_height, image_channels], 'real_input_images')\n",
" input_z = tf.placeholder(tf.float32, [None, z_dim], 'input_z')\n",
" learning_rate = tf.placeholder(tf.float32, [], 'learning_rate')\n",
" return real_input_images, input_z, learning_rate\n"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"def discriminator(images, reuse=False, alpha=0.2, keep_prob=0.5):\n",
" with tf.variable_scope('discriminator', reuse=reuse):\n",
" # Input layer is 25x25xn\n",
" # Convolutional layer, 13x13x64\n",
" conv1 = tf.layers.conv2d(images, 64, 5, 2, padding='same', kernel_initializer=tf.contrib.layers.xavier_initializer())\n",
" lrelu1 = tf.maximum(alpha * conv1, conv1)\n",
" drop1 = tf.layers.dropout(lrelu1, keep_prob)\n",
" \n",
" # Strided convolutional layer, 7x7x128\n",
" conv2 = tf.layers.conv2d(drop1, 128, 5, 2, 'same', use_bias=False)\n",
" bn2 = tf.layers.batch_normalization(conv2)\n",
" lrelu2 = tf.maximum(alpha * bn2, bn2)\n",
" drop2 = tf.layers.dropout(lrelu2, keep_prob)\n",
" \n",
" # Strided convolutional layer, 4x4x256\n",
" conv3 = tf.layers.conv2d(drop2, 256, 5, 2, 'same', use_bias=False)\n",
" bn3 = tf.layers.batch_normalization(conv3)\n",
" lrelu3 = tf.maximum(alpha * bn3, bn3)\n",
" drop3 = tf.layers.dropout(lrelu3, keep_prob)\n",
" \n",
" # fully connected\n",
" flat = tf.reshape(drop3, (-1, 4*4*256))\n",
" logits = tf.layers.dense(flat, 1)\n",
" out = tf.sigmoid(logits)\n",
" \n",
" return out, logits"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"def generator(z, out_channel_dim, is_train=True, alpha=0.2, keep_prob=0.5):\n",
" # TODO: Implement Function\n",
" with tf.variable_scope('generator', reuse=(not is_train)):\n",
" # First fully connected layer, 8x4x512\n",
" fc = tf.layers.dense(z, 4*4*1024, use_bias=False)\n",
" fc = tf.reshape(fc, (-1, 4, 4, 1024))\n",
" bn0 = tf.layers.batch_normalization(fc, training=is_train)\n",
" lrelu0 = tf.maximum(alpha * bn0, bn0)\n",
" drop0 = tf.layers.dropout(lrelu0, keep_prob, training=is_train)\n",
" \n",
" # Deconvolution, 16x8x256\n",
" conv1 = tf.layers.conv2d_transpose(drop0, 512,3, 1, 'valid', use_bias=False)\n",
" bn1 = tf.layers.batch_normalization(conv1, training=is_train)\n",
" lrelu1 = tf.maximum(alpha * bn1, bn1)\n",
" drop1 = tf.layers.dropout(lrelu1, keep_prob, training=is_train)\n",
" \n",
" # Deconvolution, 32x 128\n",
" conv2 = tf.layers.conv2d_transpose(drop1, 256, 3, 2, 'same', use_bias=False)\n",
" bn2 = tf.layers.batch_normalization(conv2, training=is_train)\n",
" lrelu2 = tf.maximum(alpha * bn2, bn2)\n",
" drop2 = tf.layers.dropout(lrelu2, keep_prob, training=is_train)\n",
" \n",
" # Output layer, 28x28xn\n",
" logits = tf.layers.conv2d_transpose(drop2, out_channel_dim, 3, 2, 'valid')\n",
" \n",
" out = tf.tanh(logits)\n",
" \n",
" print(fc.shape)\n",
" print(drop1.shape)\n",
" print(drop2.shape)\n",
" print(logits.shape)\n",
" \n",
" return out"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"def model_loss(input_real, input_z, out_channel_dim, alpha=0.2, smooth_factor=0.1):\n",
" d_model_real, d_logits_real = discriminator(input_real, alpha=alpha)\n",
" \n",
" d_loss_real = tf.reduce_mean(\n",
" tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_real,\n",
" labels=tf.ones_like(d_model_real) * (1 - smooth_factor)))\n",
" \n",
" input_fake = generator(input_z, out_channel_dim, alpha=alpha)\n",
" d_model_fake, d_logits_fake = discriminator(input_fake, reuse=True, alpha=alpha)\n",
" \n",
" d_loss_fake = tf.reduce_mean(\n",
" tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake, labels=tf.zeros_like(d_model_fake)))\n",
" \n",
" g_loss = tf.reduce_mean(\n",
" tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake, labels=tf.ones_like(d_model_fake)))\n",
"\n",
" return d_loss_real + d_loss_fake, g_loss\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"def model_opt(d_loss, g_loss, learning_rate, beta1):\n",
" # Get weights and bias to update\n",
" t_vars = tf.trainable_variables()\n",
" d_vars = [var for var in t_vars if var.name.startswith('discriminator')]\n",
" g_vars = [var for var in t_vars if var.name.startswith('generator')]\n",
"\n",
" # Optimize\n",
" with tf.control_dependencies(tf.get_collection(tf.GraphKeys.UPDATE_OPS)):\n",
" d_train_opt = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(d_loss, var_list=d_vars)\n",
" g_train_opt = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(g_loss, var_list=g_vars)\n",
"\n",
" return d_train_opt, g_train_opt\n"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"def show_generator_output(sess, n_images, input_z, out_channel_dim, image_mode):\n",
" cmap = None if image_mode == 'RGB' else 'gray'\n",
" z_dim = input_z.get_shape().as_list()[-1]\n",
" example_z = np.random.uniform(-1, 1, size=[n_images, z_dim])\n",
"\n",
" samples = sess.run(\n",
" generator(input_z, out_channel_dim, False),\n",
" feed_dict={input_z: example_z})\n",
" \n",
" # pyplot.show()\n",
" return samples"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"def train(epoch_count, batch_size, z_dim, learning_rate, beta1, get_batches, data_shape, data_image_mode,\n",
" print_every=10, show_every=10):\n",
" # TODO: Build Model\n",
" input_real, input_z, _ = model_inputs(data_shape[2], data_shape[1], data_shape[3], z_dim)\n",
" d_loss, g_loss = model_loss(input_real, input_z, data_shape[3], alpha=0.2)\n",
" d_train_opt, g_train_opt = model_opt(d_loss, g_loss, learning_rate, beta1)\n",
" \n",
" saver = tf.train.Saver()\n",
" sample_z = np.random.uniform(-1, 1, size=(72, z_dim))\n",
" \n",
" samples, losses = [], []\n",
" \n",
" steps = 0\n",
" count = 0\n",
" \n",
" with tf.Session() as sess:\n",
" saver = tf.train.Saver()\n",
" sess.run(tf.global_variables_initializer())\n",
" \n",
" # continue training\n",
" save_path = saver.save(sess, \"/tmp/model.ckpt\")\n",
" ckpt = tf.train.latest_checkpoint('./model/')\n",
" saver.restore(sess, save_path)\n",
" \n",
" #newsaver = tf.train.import_meta_graph('./model/70.meta')\n",
" #newsaver.restore(sess, tf.train.latest_checkpoint('./model/'))\n",
" \n",
" coord = tf.train.Coordinator()\n",
" threads = tf.train.start_queue_runners(sess=sess, coord=coord)\n",
"\n",
" os.mkdir('output')\n",
" for epoch_i in range(epoch_count):\n",
" for batch_images in get_batches(batch_size):\n",
" # Train Model\n",
" steps += 1\n",
" batch_images *= 2.0\n",
" \n",
" # Sample random noise for G\n",
" batch_z = np.random.uniform(-1, 1, size=(batch_size, z_dim))\n",
" \n",
" # Run optimizers\n",
" sess.run(d_train_opt, feed_dict={input_real: batch_images, input_z: batch_z})\n",
" sess.run(g_train_opt, feed_dict={input_z: batch_z})\n",
" \n",
" if steps % print_every == 0:\n",
" os.mkdir('output/'+ str(steps))\n",
" # At the end of each epoch, get the losses and print them out\n",
" train_loss_d = d_loss.eval({input_real: batch_images, input_z: batch_z})\n",
" train_loss_g = g_loss.eval({input_z: batch_z})\n",
" print(\"Epoch {}/{} Step {}...\".format(epoch_i+1, epoch_count, steps),\n",
" \"Discriminator Loss: {:.4f}...\".format(train_loss_d),\n",
" \"Generator Loss: {:.4f}\".format(train_loss_g))\n",
" # Save losses for viewing after training\n",
" #losses.append((train_loss_d, train_loss_g))\n",
" \n",
" if steps % show_every == 0:\n",
" count = count +1\n",
" iterr = count*show_every\n",
" # Show example output for the generator # 25 number for 1 time\n",
" images_grid = show_generator_output(sess, 25, input_z, data_shape[3], data_image_mode)\n",
" x = 0\n",
" for image_grid in images_grid : \n",
" x = x+1\n",
" dst = os.path.join(\"output\", str(steps),str(iterr)+str(x)+\".png\")\n",
" pyplot.imsave(dst, image_grid)\n",
" \n",
" # saving the model \n",
" if epoch_i % 10 == 0:\n",
" if not os.path.exists('./model/'):\n",
" os.makedirs('./model')\n",
" saver.save(sess, './model/' + str(epoch_i)) "
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"5004\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"INFO:tensorflow:Restoring parameters from /tmp/model.ckpt\n",
"Epoch 1/200 Step 10... Discriminator Loss: 0.7986... Generator Loss: 2.7782\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 2/200 Step 20... Discriminator Loss: 0.7019... Generator Loss: 1.2096\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 2/200 Step 30... Discriminator Loss: 0.6407... Generator Loss: 1.7675\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 3/200 Step 40... Discriminator Loss: 0.9732... Generator Loss: 0.9018\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 3/200 Step 50... Discriminator Loss: 1.2455... Generator Loss: 2.2003\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 4/200 Step 60... Discriminator Loss: 0.9650... Generator Loss: 1.1981\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 4/200 Step 70... Discriminator Loss: 0.9376... Generator Loss: 1.6022\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 5/200 Step 80... Discriminator Loss: 0.9873... Generator Loss: 0.9408\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 5/200 Step 90... Discriminator Loss: 1.1370... Generator Loss: 2.2449\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 6/200 Step 100... Discriminator Loss: 0.9307... Generator Loss: 1.1019\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 6/200 Step 110... Discriminator Loss: 0.9045... Generator Loss: 1.3023\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 7/200 Step 120... Discriminator Loss: 1.4306... Generator Loss: 3.0811\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 7/200 Step 130... Discriminator Loss: 0.8306... Generator Loss: 1.4418\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 8/200 Step 140... Discriminator Loss: 1.0130... Generator Loss: 0.9772\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 8/200 Step 150... Discriminator Loss: 1.1253... Generator Loss: 2.7651\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 9/200 Step 160... Discriminator Loss: 1.2028... Generator Loss: 0.5614\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 9/200 Step 170... Discriminator Loss: 1.1864... Generator Loss: 0.6131\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 10/200 Step 180... Discriminator Loss: 0.8613... Generator Loss: 1.1399\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 10/200 Step 190... Discriminator Loss: 0.7570... Generator Loss: 1.9568\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 11/200 Step 200... Discriminator Loss: 0.8872... Generator Loss: 1.3420\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 12/200 Step 210... Discriminator Loss: 0.7758... Generator Loss: 1.3705\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 12/200 Step 220... Discriminator Loss: 0.9375... Generator Loss: 2.3697\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 13/200 Step 230... Discriminator Loss: 1.0274... Generator Loss: 2.6057\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 13/200 Step 240... Discriminator Loss: 0.8219... Generator Loss: 1.2095\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 14/200 Step 250... Discriminator Loss: 0.8607... Generator Loss: 1.8890\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 14/200 Step 260... Discriminator Loss: 0.8661... Generator Loss: 1.4806\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 15/200 Step 270... Discriminator Loss: 0.8005... Generator Loss: 1.6766\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 15/200 Step 280... Discriminator Loss: 0.8658... Generator Loss: 1.6609\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 16/200 Step 290... Discriminator Loss: 1.3357... Generator Loss: 0.5010\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 16/200 Step 300... Discriminator Loss: 0.8518... Generator Loss: 1.4408\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 17/200 Step 310... Discriminator Loss: 0.9052... Generator Loss: 1.2558\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 17/200 Step 320... Discriminator Loss: 0.9011... Generator Loss: 1.2468\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 18/200 Step 330... Discriminator Loss: 0.9880... Generator Loss: 0.8800\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 18/200 Step 340... Discriminator Loss: 0.9066... Generator Loss: 2.0460\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 19/200 Step 350... Discriminator Loss: 0.9169... Generator Loss: 1.7369\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 19/200 Step 360... Discriminator Loss: 0.9111... Generator Loss: 1.5251\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 20/200 Step 370... Discriminator Loss: 0.9466... Generator Loss: 1.0476\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 20/200 Step 380... Discriminator Loss: 1.0600... Generator Loss: 1.6264\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 21/200 Step 390... Discriminator Loss: 1.1503... Generator Loss: 0.9095\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 22/200 Step 400... Discriminator Loss: 1.1989... Generator Loss: 1.2204\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 22/200 Step 410... Discriminator Loss: 1.1530... Generator Loss: 0.8920\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 23/200 Step 420... Discriminator Loss: 1.2206... Generator Loss: 0.8665\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 23/200 Step 430... Discriminator Loss: 1.1357... Generator Loss: 1.0771\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 24/200 Step 440... Discriminator Loss: 1.5018... Generator Loss: 0.4140\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 24/200 Step 450... Discriminator Loss: 1.1407... Generator Loss: 0.9182\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 25/200 Step 460... Discriminator Loss: 1.1208... Generator Loss: 1.0497\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 25/200 Step 470... Discriminator Loss: 1.2283... Generator Loss: 1.3409\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 26/200 Step 480... Discriminator Loss: 1.1401... Generator Loss: 0.8807\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 26/200 Step 490... Discriminator Loss: 1.1839... Generator Loss: 0.7198\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 27/200 Step 500... Discriminator Loss: 1.5919... Generator Loss: 0.3560\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 27/200 Step 510... Discriminator Loss: 1.2166... Generator Loss: 1.4234\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 28/200 Step 520... Discriminator Loss: 1.1838... Generator Loss: 1.2357\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 28/200 Step 530... Discriminator Loss: 1.2062... Generator Loss: 1.4508\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 29/200 Step 540... Discriminator Loss: 1.2600... Generator Loss: 1.5470\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 29/200 Step 550... Discriminator Loss: 1.1592... Generator Loss: 0.9399\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 30/200 Step 560... Discriminator Loss: 1.1941... Generator Loss: 1.0776\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 30/200 Step 570... Discriminator Loss: 1.5479... Generator Loss: 2.1296\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 31/200 Step 580... Discriminator Loss: 1.3233... Generator Loss: 0.8222\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch 32/200 Step 590... Discriminator Loss: 1.1821... Generator Loss: 0.9809\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 32/200 Step 600... Discriminator Loss: 1.1763... Generator Loss: 0.7344\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 33/200 Step 610... Discriminator Loss: 1.1730... Generator Loss: 1.3747\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 33/200 Step 620... Discriminator Loss: 1.5791... Generator Loss: 0.3566\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 34/200 Step 630... Discriminator Loss: 1.4445... Generator Loss: 0.4481\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 34/200 Step 640... Discriminator Loss: 1.1244... Generator Loss: 1.1338\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 35/200 Step 650... Discriminator Loss: 1.1750... Generator Loss: 0.9281\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 35/200 Step 660... Discriminator Loss: 1.2072... Generator Loss: 1.1870\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 36/200 Step 670... Discriminator Loss: 1.2960... Generator Loss: 0.5793\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n",
"Epoch 36/200 Step 680... Discriminator Loss: 1.1635... Generator Loss: 1.0436\n",
"(?, 4, 4, 1024)\n",
"(?, 6, 6, 512)\n",
"(?, 12, 12, 256)\n",
"(?, 25, 25, 3)\n"
]
},
{
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-10-bbe3447e21dd>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0mceleba_dataset\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mDataset\u001b[0m\u001b[0;34m(\u001b[0m \u001b[0mglob\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'./smallone/*.png'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mtf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mGraph\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mas_default\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 10\u001b[0;31m \u001b[0mtrain\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mepochs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbatch_size\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mz_dim\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlearning_rate\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbeta1\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mceleba_dataset\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_batches\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mceleba_dataset\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mceleba_dataset\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mimage_mode\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m<ipython-input-8-2e8656e87584>\u001b[0m in \u001b[0;36mtrain\u001b[0;34m(epoch_count, batch_size, z_dim, learning_rate, beta1, get_batches, data_shape, data_image_mode, print_every, show_every)\u001b[0m\n\u001b[1;32m 41\u001b[0m \u001b[0;31m# Run optimizers\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 42\u001b[0m \u001b[0msess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0md_train_opt\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeed_dict\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0minput_real\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbatch_images\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0minput_z\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbatch_z\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 43\u001b[0;31m \u001b[0msess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mg_train_opt\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeed_dict\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0minput_z\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbatch_z\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 44\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 45\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0msteps\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0mprint_every\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda2/envs/actionGAN/lib/python3.5/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self, fetches, feed_dict, options, run_metadata)\u001b[0m\n\u001b[1;32m 875\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 876\u001b[0m result = self._run(None, fetches, feed_dict, options_ptr,\n\u001b[0;32m--> 877\u001b[0;31m run_metadata_ptr)\n\u001b[0m\u001b[1;32m 878\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrun_metadata\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 879\u001b[0m \u001b[0mproto_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtf_session\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTF_GetBuffer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrun_metadata_ptr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda2/envs/actionGAN/lib/python3.5/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_run\u001b[0;34m(self, handle, fetches, feed_dict, options, run_metadata)\u001b[0m\n\u001b[1;32m 1098\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mfinal_fetches\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mfinal_targets\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mhandle\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mfeed_dict_tensor\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1099\u001b[0m results = self._do_run(handle, final_targets, final_fetches,\n\u001b[0;32m-> 1100\u001b[0;31m feed_dict_tensor, options, run_metadata)\n\u001b[0m\u001b[1;32m 1101\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1102\u001b[0m \u001b[0mresults\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda2/envs/actionGAN/lib/python3.5/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_do_run\u001b[0;34m(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)\u001b[0m\n\u001b[1;32m 1270\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mhandle\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1271\u001b[0m return self._do_call(_run_fn, feeds, fetches, targets, options,\n\u001b[0;32m-> 1272\u001b[0;31m run_metadata)\n\u001b[0m\u001b[1;32m 1273\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1274\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_do_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0m_prun_fn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhandle\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeeds\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfetches\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda2/envs/actionGAN/lib/python3.5/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_do_call\u001b[0;34m(self, fn, *args)\u001b[0m\n\u001b[1;32m 1276\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_do_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1277\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1278\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1279\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0merrors\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mOpError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1280\u001b[0m \u001b[0mmessage\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcompat\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mas_text\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda2/envs/actionGAN/lib/python3.5/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_run_fn\u001b[0;34m(feed_dict, fetch_list, target_list, options, run_metadata)\u001b[0m\n\u001b[1;32m 1261\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_extend_graph\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1262\u001b[0m return self._call_tf_sessionrun(\n\u001b[0;32m-> 1263\u001b[0;31m options, feed_dict, fetch_list, target_list, run_metadata)\n\u001b[0m\u001b[1;32m 1264\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1265\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_prun_fn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mhandle\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeed_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfetch_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda2/envs/actionGAN/lib/python3.5/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_call_tf_sessionrun\u001b[0;34m(self, options, feed_dict, fetch_list, target_list, run_metadata)\u001b[0m\n\u001b[1;32m 1348\u001b[0m return tf_session.TF_SessionRun_wrapper(\n\u001b[1;32m 1349\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_session\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0moptions\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeed_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfetch_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtarget_list\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1350\u001b[0;31m run_metadata)\n\u001b[0m\u001b[1;32m 1351\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1352\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_call_tf_sessionprun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhandle\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeed_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfetch_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
]
}
],
"source": [
"batch_size = 256\n",
"z_dim = 100\n",
"learning_rate = 0.00025\n",
"beta1 = 0.45\n",
"\n",
"epochs = 200\n",
"print(len(glob('./smallone/*.png')))\n",
"celeba_dataset = Dataset( glob('./smallone/*.png'))\n",
"with tf.Graph().as_default():\n",
" train(epochs, batch_size, z_dim, learning_rate, beta1, celeba_dataset.get_batches, celeba_dataset.shape, celeba_dataset.image_mode)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.0"
}
},
"nbformat": 4,
"nbformat_minor": 1
}