当前位置:   article > 正文

使用Labelimg标注出现错误:ValueError: not enough values to unpack (expected 5, got 1)

valueerror: not enough values to unpack (expected 5, got 1)
  1. Traceback (most recent call last):
  2. File "D:\anaconda\b\envs\labelimg\lib\site-packages\labelImg\labelImg.py", line 1376, in open_next_image
  3. self.load_file(filename)
  4. File "D:\anaconda\b\envs\labelimg\lib\site-packages\labelImg\labelImg.py", line 1111, in load_file
  5. self.show_bounding_box_from_annotation_file(file_path)
  6. File "D:\anaconda\b\envs\labelimg\lib\site-packages\labelImg\labelImg.py", line 1154, in show_bounding_box_from_annotation_file
  7. self.load_yolo_txt_by_filename(txt_path)
  8. File "D:\anaconda\b\envs\labelimg\lib\site-packages\labelImg\labelImg.py", line 1557, in load_yolo_txt_by_filename
  9. t_yolo_parse_reader = YoloReader(txt_path, self.image)
  10. File "D:\anaconda\b\envs\labelimg\lib\site-packages\libs\yolo_io.py", line 112, in __init__
  11. self.parse_yolo_format()
  12. File "D:\anaconda\b\envs\labelimg\lib\site-packages\libs\yolo_io.py", line 142, in parse_yolo_format
  13. class_index, x_center, y_center, w, h = bndBox.strip().split(' ')
  14. ValueError: not enough values to unpack (expected 5, got 1)

错误翻译:期待返回5个值,只返回了1个。

错误原因:存在回车键(对应的txt文件或下一个)

解决办法:检查对应的文件txt是否有多余回车键,删掉。

 没有多余行,就能解决问题了。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/462034
推荐阅读
相关标签
  

闽ICP备14008679号