Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add informative msg when img size mismatch #296

Merged
merged 1 commit into from
Jun 15, 2018

Conversation

spacemunkay
Copy link
Contributor

Print a useful error message when there is a misconfiguration with image sizes.

Example error:

Traceback (most recent call last):
  File "main.py", line 103, in <module>
    tf.app.run()
  File "/usr/local/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run
    _sys.exit(main(argv))
  File "main.py", line 81, in main
    data_dir=FLAGS.data_dir)
  File "/Users/jdenney/workspace/github/forks/DCGAN-tensorflow/model.py", line 94, in __init__
    self.build_model()
  File "/Users/jdenney/workspace/github/forks/DCGAN-tensorflow/model.py", line 119, in build_model
    self.D_, self.D_logits_ = self.discriminator(self.G, self.y, reuse=True)
  File "/Users/jdenney/workspace/github/forks/DCGAN-tensorflow/model.py", line 333, in discriminator
    h4 = linear(tf.reshape(h3, [self.batch_size, -1]), 1, 'd_h4_lin')
  1 [user]
  File "/Users/jdenney/workspace/github/forks/DCGAN-tensorflow/ops.py", line 99, in linear
    tf.random_normal_initializer(stddev=stddev))
  File "/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 1317, in get_variable
    constraint=constraint)
  File "/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 1079, in get_variable
    constraint=constraint)
  File "/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 425, in get_variable
    constraint=constraint)
  File "/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 394, in _true_getter
    use_resource=use_resource, constraint=constraint)
  File "/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/variable_scope.py", line 738, in _get_single_variable
    found_var.get_shape()))
ValueError: ('Trying to share variable discriminator/d_h4_lin/Matrix, but specified shape (8192, 1) and found shape (25088, 1).', "NOTE: Usually, this is due to an issue with the image dimensions.  Did you correctly set '--crop' or '--input_height' or '--output_height'?")

Potentially closes #178

@carpedm20 carpedm20 merged commit 351a654 into carpedm20:master Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants