cnyvfang / labelGo-Yolov5AutoLabelImg

YOLOV5 semi-automatic annotation tool (Based on labelImg)
MIT License
449 stars 64 forks source link

IndexError: list index out of range #1

Closed WangRongsheng closed 3 years ago

WangRongsheng commented 3 years ago
C:\Users\60332\Desktop\labelGo-Yolov5AutoLabelImg>python labelGo.py
Traceback (most recent call last):
  File "labelGo.py", line 1316, in open_dir_dialog
    self.import_dir_images(target_dir_path)
  File "labelGo.py", line 1384, in import_dir_images
    self.open_next_image()
  File "labelGo.py", line 1458, in open_next_image
    self.load_file(filename)
  File "labelGo.py", line 1137, in load_file
    self.show_bounding_box_from_annotation_file(file_path)
  File "labelGo.py", line 1180, in show_bounding_box_from_annotation_file
    self.load_yolo_txt_by_filename(txt_path)
  File "labelGo.py", line 1639, in load_yolo_txt_by_filename
    t_yolo_parse_reader = YoloReader(txt_path, self.image)
  File "C:\Users\60332\Desktop\labelGo-Yolov5AutoLabelImg\libs\yolo_io.py", line 112, in __init__
    self.parse_yolo_format()
  File "C:\Users\60332\Desktop\labelGo-Yolov5AutoLabelImg\libs\yolo_io.py", line 143, in parse_yolo_format
    label, x_min, y_min, x_max, y_max = self.yolo_line_to_shape(class_index, x_center, y_center, w, h)
  File "C:\Users\60332\Desktop\labelGo-Yolov5AutoLabelImg\libs\yolo_io.py", line 125, in yolo_line_to_shape
    label = self.classes[int(class_index)]
IndexError: list index out of range
cnyvfang commented 3 years ago

你好,方便告诉我你使用的Python是哪个版本吗。 请问是在启动的时候就直接出现了该错误还是在启动后的某一步操作中出现了该错误。

WangRongsheng commented 3 years ago

你好,方便告诉我你使用的Python是哪个版本吗。 请问是在启动的时候就直接出现了该错误还是在启动后的某一步操作中出现了该错误。

我的python版本是3.6.5,使用的模型是yolov5的官方权重yolov5s.pt,在点选了打开目录后出现了该错误,并且我并没有发现设置中文的的按钮,感谢帮忙解决,期待你的回复~

cnyvfang commented 3 years ago

你可以试试使用Python3.8看看是否仍然会遇到相同的问题,语言的话是跟系统同步的,系统语言是简体中文默认进入软件就会是简体中文的。

WangRongsheng commented 3 years ago

你可以试试使用Python3.8看看是否仍然会遇到相同的问题,语言的话是跟系统同步的,系统语言是简体中文默认进入软件就会是简体中文的。

错误原因: yolov5s.pt有众多的预测分类,我的classes.txt只有person一个类,一旦预测到其他类别的物体就会出现以上错误。

解决方案: 保证预测的模型结果均被写入了classes.txt文件

该issue可以关闭了哦~谢谢帮忙

cnyvfang commented 3 years ago

你好,有用户向我反馈你在CSDN及面包多等平台上出售我的项目,我本人不希望该项目被以任何形式盈利,希望你能够撤回。

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Hpu王荣胜 @.> Sent: Thursday, August 19, 2021 4:05:20 PM To: cnyvfang/labelGo-Yolov5AutoLabelImg @.> Cc: EricFang @.>; Comment @.> Subject: Re: [cnyvfang/labelGo-Yolov5AutoLabelImg] IndexError: list index out of range (#1)

你可以试试使用Python3.8看看是否仍然会遇到相同的问题,语言的话是跟系统同步的,系统语言是简体中文默认进入软件就会是简体中文的。

错误原因: yolov5s.pt有众多的预测分类,我的classes.txt只有person一个类,一旦预测到其他类别的物体就会出现以上错误。

解决方案: 保证预测的模型结果均被写入了classes.txt文件

该issue可以关闭了哦~谢谢帮忙

― You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/cnyvfang/labelGo-Yolov5AutoLabelImg/issues/1#issuecomment-901700188, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIWZU5FTBXZ7VC33NAOHUE3T5S3MBANCNFSM5CNL7V2A. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.