Skip to content

Commit

Permalink
Add informative msg when img size mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemunkay committed Jun 12, 2018
1 parent 3041fa3 commit e4d949f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ def linear(input_, output_size, scope=None, stddev=0.02, bias_start=0.0, with_w=
shape = input_.get_shape().as_list()

with tf.variable_scope(scope or "Linear"):
matrix = tf.get_variable("Matrix", [shape[1], output_size], tf.float32,
try:
matrix = tf.get_variable("Matrix", [shape[1], output_size], tf.float32,
tf.random_normal_initializer(stddev=stddev))
except ValueError as err:
msg = "NOTE: Usually, this is due to an issue with the image dimensions. Did you correctly set '--crop' or '--input_height' or '--output_height'?"
err.args = err.args + (msg,)
raise
bias = tf.get_variable("bias", [output_size],
initializer=tf.constant_initializer(bias_start))
if with_w:
Expand Down

2 comments on commit e4d949f

@mansooRTURk
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

photo of great wall of china

@lihh1023
Copy link

@lihh1023 lihh1023 commented on e4d949f May 28, 2023 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.