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

train.py #61

Open
ZhengHeZhe opened this issue Jan 13, 2020 · 2 comments
Open

train.py #61

ZhengHeZhe opened this issue Jan 13, 2020 · 2 comments

Comments

@ZhengHeZhe
Copy link

The following error occurred while running train.py. Can anyone give me some advice?

Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2084, in cond
nest.assert_same_structure(orig_res_t, orig_res_f)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/nest.py", line 183, in assert_same_structure
_pywrap_tensorflow.AssertSameStructure(nest1, nest2, check_types)
ValueError: The two structures don't have the same nested structure.

First structure: type=tuple str=([800, 600, 700, 900, 1000, 1100, 1200], <tf.Tensor 'get_batch/cond/floordiv:0' shape=(7,) dtype=int32>)

Second structure: type=tuple str=(<tf.Tensor 'get_batch/cond/floordiv_1:0' shape=(7,) dtype=int32>, [800, 600, 700, 900, 1000, 1100, 1200])

More specifically: Substructure "type=list str=[800, 600, 700, 900, 1000, 1100, 1200]" is a sequence, while substructure "type=Tensor str=Tensor("get_batch/cond/floordiv_1:0", shape=(7,), dtype=int32)" is not

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/media/ys/000F3E52000A91C0/zheng/R2CNN-Plus-Plus_Tensorflow-master (2)/tools/train.py", line 230, in
train()
File "/media/ys/000F3E52000A91C0/zheng/R2CNN-Plus-Plus_Tensorflow-master (2)/tools/train.py", line 37, in train
is_training=True)
File "/media/ys/000F3E52000A91C0/zheng/R2CNN-Plus-Plus_Tensorflow-master (2)/data/io/read_tfrecord.py", line 87, in next_batch
is_training=is_training)
File "/media/ys/000F3E52000A91C0/zheng/R2CNN-Plus-Plus_Tensorflow-master (2)/data/io/read_tfrecord.py", line 61, in read_and_prepocess_single_img
target_shortside_len=shortside_len)
File "/media/ys/000F3E52000A91C0/zheng/R2CNN-Plus-Plus_Tensorflow-master (2)/data/io/image_preprocess.py", line 24, in short_side_resize
false_fn=lambda: (target_shortside_len * h//w, target_shortside_len))
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/deprecation.py", line 432, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/control_flow_ops.py", line 2090, in cond
"Incompatible return values of true_fn and false_fn: {}".format(e))
ValueError: Incompatible return values of true_fn and false_fn: The two structures don't have the same nested structure.

First structure: type=tuple str=([800, 600, 700, 900, 1000, 1100, 1200], <tf.Tensor 'get_batch/cond/floordiv:0' shape=(7,) dtype=int32>)

Second structure: type=tuple str=(<tf.Tensor 'get_batch/cond/floordiv_1:0' shape=(7,) dtype=int32>, [800, 600, 700, 900, 1000, 1100, 1200])

More specifically: Substructure "type=list str=[800, 600, 700, 900, 1000, 1100, 1200]" is a sequence, while substructure "type=Tensor str=Tensor("get_batch/cond/floordiv_1:0", shape=(7,), dtype=int32)" is not

@Arthur-Shi
Copy link

false_fn=lambda: (target_shortside_len * h//w, target_shortside_len))
你看一下你设置的参数,你使用错误了.

@ZhengHeZhe
Copy link
Author

false_fn=lambda: (target_shortside_len * h//w, target_shortside_len))
你看一下你设置的参数,你使用错误了.

设置的参数就时代码里原本的参数,使用错误是指?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants