R2CNN-Plus-Plus_Tensorflow icon indicating copy to clipboard operation
R2CNN-Plus-Plus_Tensorflow copied to clipboard

train.py

Open ZhengHeZhe opened this issue 5 years ago • 2 comments

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

ZhengHeZhe avatar Jan 13 '20 11:01 ZhengHeZhe

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

Arthur-Shi avatar Jan 14 '20 03:01 Arthur-Shi

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

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

ZhengHeZhe avatar Jan 14 '20 03:01 ZhengHeZhe