Object-Detection-Tensorflow
Object-Detection-Tensorflow copied to clipboard
fcos, Cannot batch tensors with different shapes
大神,请问这bug怎么解决呀? 我的参数: lr = 0.01 batch_size = 8 buffer_size = 256 epochs = 160 reduce_lr_epoch = [] config = { 'mode': 'train', # 'train', 'test' 'data_shape': [800, 1200, 3], 'data_format': 'channels_last', # 'channels_last' 'channels_first' 'num_classes': 20, 'weight_decay': 1e-4, 'keep_prob': 0.5, # not used 'batch_size': batch_size,
'nms_score_threshold': 0.5,
'nms_max_boxes': 10,
'nms_iou_threshold': 0.45,
}
image_augmentor_config = { 'data_format': 'channels_last', 'output_shape': [800, 1200], # 'zoom_size': [400, 400], # 'crop_method': 'random', 'flip_prob': [0., 0.5], 'fill_mode': 'BILINEAR', 'keep_aspect_ratios': False, # 'constant_values': 0., # 'color_jitter_prob': 0.5, # 'rotate': [0.5, -5., -5.], 'pad_truth_to': 60, }
运行testfcos.py后出现: File "/home/work/lza/Object-Detection-Tensorflow/FCOS.py", line 444, in _gn trainable=self.is_training
TypeError: Using a tf.Tensor as a Python bool is not allowed. Use if t is not None: instead of if t: to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.
我把相应的地方改成True了,想先跑起来。 随后又出现了下面的bug:
Caused by op 'IteratorGetNext', defined at:
File "testfcos.py", line 59, in
InvalidArgumentError (see above for traceback): Cannot batch tensors with different shapes in component 0. First element had shape [333,500,3] and element 1 had shape [351,500,3]. [[node IteratorGetNext (defined at /home/work/lza/Object-Detection-Tensorflow/FCOS.py:60) ]]
test_voc_utils.py:None (test_voc_utils.py)
ImportError while importing test module 'D:\Object-Detection-Tensorflow-master\utils\test_voc_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
i dont konw how to solve