INFO:tensorflow:Error ,,,All bounding box coordinates must be in [0.0, 1.0]: 1.36531126

 

win10 tensorflow ssd在训练自己的数据时遇到这个错误:

INFO:tensorflow:Error reported to Coordinator: <class 'tensorflow.python.framework.errors_impl.InvalidArgumentError'>, All bounding box coordinates must be in [0.0, 1.0]: 1.36531126
     [[Node: ssd_preprocessing_train/distorted_bounding_box_crop/sample_distorted_bounding_box/SampleDistortedBoundingBoxV2 = SampleDistortedBoundingBoxV2[T=DT_INT32, area_range=[0.1, 1], aspect_ratio_range=[0.6, 1.67], max_attempts=200, seed=0, seed2=0, use_image_if_no_bounding_boxes=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](ssd_preprocessing_train/distorted_bounding_box_crop/Shape, ssd_preprocessing_train/ExpandDims_1, ssd_preprocessing_train/distorted_bounding_box_crop/sample_distorted_bounding_box/SampleDistortedBoundingBoxV2/min_object_covered)]]
INFO:tensorflow:Finished training! Saving model to disk.
Traceback (most recent call last):
  File "D:/work/SSD-Tensorflow-master/train_ssd_network.py", line 392, in <module>
    tf.app.run()
  File "C:\Users\11327\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\platform\app.py", line 125, in run
    _sys.exit(main(argv))
  File "D:/work/SSD-Tensorflow-master/train_ssd_network.py", line 388, in main
    sync_optimizer=None)
  File "C:\Users\11327\AppData\Roaming\Python\Python36\site-packages\tensorflow\contrib\slim\python\slim\learning.py", line 785, in train
    ignore_live_threads=ignore_live_threads)
  File "C:\Users\11327\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\training\supervisor.py", line 833, in stop
    ignore_live_threads=ignore_live_threads)
  File "C:\Users\11327\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\training\coordinator.py", line 389, in join
    six.reraise(*self._exc_info_to_raise)
  File "D:\python\soft\lib\site-packages\six.py", line 693, in reraise
    raise value
  File "C:\Users\11327\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\training\queue_runner_impl.py", line 252, in _run
    enqueue_callable()
  File "C:\Users\11327\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 1244, in _single_operation_run
    self._call_tf_sessionrun(None, {}, [], target_list, None)
  File "C:\Users\11327\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\client\session.py", line 1409, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: All bounding box coordinates must be in [0.0, 1.0]: 1.36531126
     [[Node: ssd_preprocessing_train/distorted_bounding_box_crop/sample_distorted_bounding_box/SampleDistortedBoundingBoxV2 = SampleDistortedBoundingBoxV2[T=DT_INT32, area_range=[0.1, 1], aspect_ratio_range=[0.6, 1.67], max_attempts=200, seed=0, seed2=0, use_image_if_no_bounding_boxes=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](ssd_preprocessing_train/distorted_bounding_box_crop/Shape, ssd_preprocessing_train/ExpandDims_1, ssd_preprocessing_train/distorted_bounding_box_crop/sample_distorted_bounding_box/SampleDistortedBoundingBoxV2/min_object_covered)]]

Process finished with exit code 1

分析:标注不规范引起的,只需找出对应不规范的图片,修改即可。

解决:

在这段代码下: 
       bboxes.append((max(float(bbox.find('ymin').text) / shape[0],0.0),
                       max(float(bbox.find('xmin').text) / shape[1],0.0),
                       min(float(bbox.find('ymax').text) / shape[0],1.0),
                       min(float(bbox.find('xmax').text) / shape[1],1.0)
                       ))
添加这个检测程序:
        if float(bbox.find('xmax').text) > shape[1]:   #lll
            print(shape[1])
        if float(bbox.find('ymax').text) > shape[0]:  # lll
            print(shape[0])
        if float(bbox.find('ymin').text) < 0.1:  # lll
            print(shape[0])
        if float(bbox.find('xmin').text) < 0.1:  # lll
             print(shape[0])

#有越界的标注框则打印输出图像宽或者高

发现第1732张图片即编号为1736的图片有标注框越界。点开这个图,重新标注即可。或者直接删除。
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值