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
While trying to train this model on my customized dataset it gives an error :InvalidArgumentError (see above for traceback): Incompatible shapes: [1,272,480] vs. [1,1088,1920] [[node sub (defined at /workspace/mscnn/mscnn.py:326) = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]
#19
Open
sratandeep16 opened this issue
Feb 26, 2019
· 4 comments
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1,272,480] vs. [1,1088,1920]
[[{{node sub}} = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "mscnn_train.py", line 159, in
tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "mscnn_train.py", line 155, in main
train()
File "mscnn_train.py", line 117, in train
_, loss_value = sess.run([train_op, loss], feed_dict={image: np_xs, label: np_ys})
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1328, in _do_run
run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1,272,480] vs. [1,1088,1920]
[[node sub (defined at /workspace/mscnn/mscnn.py:326) = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]
Caused by op 'sub', defined at:
File "mscnn_train.py", line 159, in
tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "mscnn_train.py", line 155, in main
train()
File "mscnn_train.py", line 63, in train
loss = mscnn.loss(predicts, label) # 计算损失
File "/workspace/mscnn/mscnn.py", line 326, in loss
l2_loss = tf.reduce_sum((predict - label) * (predict - label))
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/math_ops.py", line 866, in binary_op_wrapper
return func(x, y, name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gen_math_ops.py", line 8318, in sub
"Sub", x=x, y=y, name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/deprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 3274, in create_op
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 1770, in init
self._traceback = tf_stack.extract_stack()
InvalidArgumentError (see above for traceback): Incompatible shapes: [1,272,480] vs. [1,1088,1920]
[[node sub (defined at /workspace/mscnn/mscnn.py:326) = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]
The text was updated successfully, but these errors were encountered:
sratandeep16
changed the title
While trying to train this model on my customized data it gives an error :InvalidArgumentError (see above for traceback): Incompatible shapes: [1,272,480] vs. [1,1088,1920] [[node sub (defined at /workspace/mscnn/mscnn.py:326) = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]
While trying to train this model on my customized dataset it gives an error :InvalidArgumentError (see above for traceback): Incompatible shapes: [1,272,480] vs. [1,1088,1920] [[node sub (defined at /workspace/mscnn/mscnn.py:326) = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]
Feb 26, 2019
HELLO,did you handle this problem?I meet the same problem with you,maybe the reason is that the size of our own dataset is different with the given dataset.
I delete the sentence "predict = tf.squeeze(predict, 3)" in main.py, and it could work in training, and need to add the sentence back while evaluating. But got terrible result in eval, the loss is inf : (
I delete the sentence "predict = tf.squeeze(predict, 3)" in main.py, and it could work in training, and need to add the sentence back while evaluating. But got terrible result in eval, the loss is inf : (
hi, do u know how long did u run the training project?
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1334, in _do_call
return fn(*args)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1319, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1,272,480] vs. [1,1088,1920]
[[{{node sub}} = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "mscnn_train.py", line 159, in
tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "mscnn_train.py", line 155, in main
train()
File "mscnn_train.py", line 117, in train
_, loss_value = sess.run([train_op, loss], feed_dict={image: np_xs, label: np_ys})
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 929, in run
run_metadata_ptr)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1152, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1328, in _do_run
run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1348, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Incompatible shapes: [1,272,480] vs. [1,1088,1920]
[[node sub (defined at /workspace/mscnn/mscnn.py:326) = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]
Caused by op 'sub', defined at:
File "mscnn_train.py", line 159, in
tf.app.run()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "mscnn_train.py", line 155, in main
train()
File "mscnn_train.py", line 63, in train
loss = mscnn.loss(predicts, label) # 计算损失
File "/workspace/mscnn/mscnn.py", line 326, in loss
l2_loss = tf.reduce_sum((predict - label) * (predict - label))
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/math_ops.py", line 866, in binary_op_wrapper
return func(x, y, name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gen_math_ops.py", line 8318, in sub
"Sub", x=x, y=y, name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/deprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 3274, in create_op
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 1770, in init
self._traceback = tf_stack.extract_stack()
InvalidArgumentError (see above for traceback): Incompatible shapes: [1,272,480] vs. [1,1088,1920]
[[node sub (defined at /workspace/mscnn/mscnn.py:326) = Sub[T=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"](Squeeze, _arg_Placeholder_1_0_1/_111)]]
The text was updated successfully, but these errors were encountered: