DCGAN-tensorflow icon indicating copy to clipboard operation
DCGAN-tensorflow copied to clipboard

crash after recent commits: assert manifold_w * manifold_h == num_images

Open paolorota opened this issue 7 years ago • 4 comments

Got problem while saving the samples:

Traceback (most recent call last):
  File "main.py", line 97, in <module>
    tf.app.run()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "main.py", line 80, in main
    dcgan.train(FLAGS)
  File "/home/prota/Downloads/DCGAN-tensorflow-master/model.py", line 298, in train
    save_images(samples, image_manifold_size(samples.shape[0]),
  File "/home/prota/Downloads/DCGAN-tensorflow-master/utils.py", line 249, in image_manifold_size
    assert manifold_w * manifold_h == num_images
AssertionError

manifold_w == 8 while manifold_h == 64. should be both 8 if images are 64?

paolorota avatar Jun 21 '17 14:06 paolorota

I suppose there is also a pull request for this.

paolorota avatar Jun 21 '17 14:06 paolorota

hi , I meet this problem also,do you find way to solve this problem?

xieenze avatar Oct 18 '17 08:10 xieenze

ha I find it! the batch_size must be set as n * n,such as 16(4 * 4),64(8*8,default)or other. otherwise the assert will throws the exception. but I don't know why.

xieenze avatar Oct 18 '17 08:10 xieenze

Replying to a very old topic here, but I wanted to quickly document this solution for the issue. I'm working on implementing another project that is based on DCGAN-tensorflow.

ha I find it! the batch_size must be set as n * n,such as 16(4 * 4),64(8*8,default)or other. otherwise the assert will throws the exception. but I don't know why.

n*n for batch_size didn't work for me. Tried 4 & 16 with both crashing soon into training with the assertion error.

However, setting sample_size to (n * n) did work for me. I used 16(4*4) for that test and the training fully completed. That was also with batch_size set to 1 just to rule that out completely. I haven't tested other sizes for sample_size yet.

JohnHammell avatar Feb 11 '19 23:02 JohnHammell