Pytorch-yolov3: IndexError: list index out of range(while training on custom dataset with two classes)

Created on 3 May 2020  路  4Comments  路  Source: eriklindernoren/PyTorch-YOLOv3

Traceback (most recent call last):
File "train.py", line 173, in
ap_table += [[c, class_names[c], "%.5f" % AP[i]]]
IndexError: list index out of range

Most helpful comment

Hello, in utils.py, load_classes change

    names = fp.read().split("\n")[:-1]

To

    names = fp.read().split("\n")

I don't really understand why in the loader they are not taking the last class into account, but I just changed there. Then it should work

All 4 comments

Hello, in utils.py, load_classes change

    names = fp.read().split("\n")[:-1]

To

    names = fp.read().split("\n")

I don't really understand why in the loader they are not taking the last class into account, but I just changed there. Then it should work

Hello, in utils.py, load_classes change

    names = fp.read().split("\n")[:-1]

To

    names = fp.read().split("\n")

I don't really understand why in the loader they are not taking the last class into account, but I just changed there. Then it should work

Thank you. It worked for me as I just press enter at the end of the line in the classes.names file. If you know how to detect the video, please do let me know.

Thanks

hello锛寃hy is my cls_acc==100%,

thanks,i also solved it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MessiahChen picture MessiahChen  路  3Comments

zhaowt61 picture zhaowt61  路  4Comments

a954217436 picture a954217436  路  4Comments

MAP
nationalflag picture nationalflag  路  5Comments

Damon2019 picture Damon2019  路  5Comments