You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tensorflow_cnn 改变图片宽高,训练即失败,代码已定义常量IMAGE_HEIGHT、IMAGE_WIDTH,在此改变无法生效会报错,后面训练相关代码不会自适应图片宽高的改变
Traceback (most recent call last):
File "TensorFlow_cnn_train.py", line 197, in
train_crack_captcha_cnn()
File "TensorFlow_cnn_train.py", line 183, in train_crack_captcha_cnn , loss = sess.run([optimizer, loss], feed_dict={X: batch_x, Y: batch_y, keep_prob: 0.75})
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 778, in run
run_metadata_ptr)
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 982, in _run
feed_dict_string, options, run_metadata)
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 1032, in _do_run
target_list, options, run_metadata)
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 1052, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [26,315] vs. [64,315]
[[Node: logistic_loss/mul = Mul[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"](Add_1, _recv_Placeholder_1_0)]]
Caused by op u'logistic_loss/mul', defined at:
File "TensorFlow_cnn_train.py", line 197, in
train_crack_captcha_cnn()
File "TensorFlow_cnn_train.py", line 165, in train_crack_captcha_cnn
loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits=output, labels=Y))
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/nn_impl.py", line 171, in sigmoid_cross_entropy_with_logits
return math_ops.add(relu_logits - logits * labels,
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/math_ops.py", line 821, in binary_op_wrapper
return func(x, y, name=name)
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/math_ops.py", line 1044, in _mul_dispatch
return gen_math_ops._mul(x, y, name=name)
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/gen_math_ops.py", line 1434, in _mul
result = _op_def_lib.apply_op("Mul", x=x, y=y, name=name)
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
op_def=op_def)
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 2336, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 1228, in init
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): Incompatible shapes: [26,315] vs. [64,315]
[[Node: logistic_loss/mul = Mul[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"](Add_1, _recv_Placeholder_1_0)]]
The text was updated successfully, but these errors were encountered:
tensorflow_cnn 改变图片宽高,训练即失败,代码已定义常量IMAGE_HEIGHT、IMAGE_WIDTH,在此改变无法生效会报错,后面训练相关代码不会自适应图片宽高的改变
Traceback (most recent call last):
File "TensorFlow_cnn_train.py", line 197, in
train_crack_captcha_cnn()
File "TensorFlow_cnn_train.py", line 183, in train_crack_captcha_cnn
, loss = sess.run([optimizer, loss], feed_dict={X: batch_x, Y: batch_y, keep_prob: 0.75})
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 778, in run
run_metadata_ptr)
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 982, in _run
feed_dict_string, options, run_metadata)
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 1032, in _do_run
target_list, options, run_metadata)
File "/Library/Python/2.7/site-packages/tensorflow/python/client/session.py", line 1052, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [26,315] vs. [64,315]
[[Node: logistic_loss/mul = Mul[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"](Add_1, _recv_Placeholder_1_0)]]
Caused by op u'logistic_loss/mul', defined at:
File "TensorFlow_cnn_train.py", line 197, in
train_crack_captcha_cnn()
File "TensorFlow_cnn_train.py", line 165, in train_crack_captcha_cnn
loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits=output, labels=Y))
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/nn_impl.py", line 171, in sigmoid_cross_entropy_with_logits
return math_ops.add(relu_logits - logits * labels,
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/math_ops.py", line 821, in binary_op_wrapper
return func(x, y, name=name)
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/math_ops.py", line 1044, in _mul_dispatch
return gen_math_ops._mul(x, y, name=name)
File "/Library/Python/2.7/site-packages/tensorflow/python/ops/gen_math_ops.py", line 1434, in _mul
result = _op_def_lib.apply_op("Mul", x=x, y=y, name=name)
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
op_def=op_def)
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 2336, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 1228, in init
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): Incompatible shapes: [26,315] vs. [64,315]
[[Node: logistic_loss/mul = Mul[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"](Add_1, _recv_Placeholder_1_0)]]
The text was updated successfully, but these errors were encountered: