carpedm20 / DCGAN-tensorflow

A tensorflow implementation of "Deep Convolutional Generative Adversarial Networks"
http://carpedm20.github.io/faces/
MIT License
7.15k stars 2.63k forks source link

Value error while attempting to train on mnist dataset "ValueError: Trying to share variable discriminator/d_h2_lin/Matrix, but specified shape (18954, 1024) and found shape (3636, 1024)." #116

Closed dopetard closed 7 years ago

dopetard commented 7 years ago

I am using Tensorfow 1.0 recent release.

Traceback (most recent call last): File "main.py", line 96, in tf.app.run() File "/home/ankur/python/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 44, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "main.py", line 62, in main sample_dir=FLAGS.sample_dir) File "/home/ankur/DCGAN/DCGAN-tensorflow/model.py", line 75, in init self.build_model() File "/home/ankur/DCGAN/DCGAN-tensorflow/model.py", line 105, in build_model self.discriminator(self.G, self.y, reuse=True) File "/home/ankur/DCGAN/DCGAN-tensorflow/model.py", line 341, in discriminator h2 = lrelu(self.d_bn2(linear(h1, self.dfc_dim, 'd_h2_lin'))) File "/home/ankur/DCGAN/DCGAN-tensorflow/ops.py", line 98, in linear tf.random_normal_initializer(stddev=stddev)) File "/home/ankur/python/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 988, in get_variable custom_getter=custom_getter) File "/home/ankur/python/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 890, in get_variable custom_getter=custom_getter) File "/home/ankur/python/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 348, in get_variable validate_shape=validate_shape) File "/home/ankur/python/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 333, in _true_getter caching_device=caching_device, validate_shape=validate_shape) File "/home/ankur/python/lib/python2.7/site-packages/tensorflow/python/ops/variable_scope.py", line 644, in _get_single_variable found_var.get_shape())) ValueError: Trying to share variable discriminator/d_h2_lin/Matrix, but specified shape (18954, 1024) and found shape (3636, 1024). ankur@node7:~/DCGAN/DCGAN-tensorflow$

dopetard commented 7 years ago

getting same error while training with Tensorflow 1.2 and while testing with the existing model