Computing AP: 4%|โโโ | 1/24 [00:00<00:03, 6.08it/Computing AP: 12%|โโโโโโโโโ | 3/24 [00:00<00:03, 6Computing AP: 25%|โโโโโโโโโโโโโโโโโโ | 6/24 [00:00<Computing AP: 46%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ |Computing AP: 58%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Computing AP: 96%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Computing AP: 100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ| 24/24 [00:00<00:00, 25.96it/s]
Traceback (most recent call last):
File "train.py", line 173, in <module>
ap_table += [[c, class_names[c], "%.5f" % AP[i]]]
IndexError: list index out of range
ap_table = [["Index", "Class name", "AP"]]
for i, c in enumerate(ap_class):
ap_table += [[c, class_names[c], "%.5f" % AP[i]]]
print(AsciiTable(ap_table).table)
print(f"---- mAP {AP.mean()}")
This module might have some problems in my custom training, do you know what happened?
I have the same problem!
I found the solution! In your custom class name file (/data/custom/classes.names), you need to leave an empty line at the end.
Because in utils/utils.py, the function "load_classes" parses the name file like this: [:-1], which ends up only selecting the first n-1 names in the file if u don't leave an empty line at the end.
If you look at the coco dataset name file, you'll find that empty line in the end as well. (data/coco.names)
I tried removing the empty line and change the [:-1] to [:], but somehow the evaluation gets stuck and not working. It's really weird. But anyways, it should be working with this fix.
I found the solution! In your custom class name file (/data/custom/classes.names), you need to leave an empty line at the end.
Because in utils/utils.py, the function "load_classes" parses the name file like this: [:-1], which ends up only selecting the first n-1 names in the file if u don't leave an empty line at the end.
If you look at the coco dataset name file, you'll find that empty line in the end as well. (data/coco.names)
I tried removing the empty line and change the [:-1] to [:], but somehow the evaluation gets stuck and not working. It's really weird. But anyways, it should be working with this fix.
I followed your guide and succeeded. Thank you so much.
@SirongHuang Awesome. Thanks .:)
SirongHuang
Awesome. Thanks
SirongHuang
Awesome. Thanks
SirongHuang
Awesome.Thanks
Awsome, Thanks
Is this issue still relevant/occurring?
I closed this issue due to inactivity. Feel free to reopen for further discussion.
Most helpful comment
I found the solution! In your custom class name file (/data/custom/classes.names), you need to leave an empty line at the end.
Because in utils/utils.py, the function "load_classes" parses the name file like this: [:-1], which ends up only selecting the first n-1 names in the file if u don't leave an empty line at the end.
If you look at the coco dataset name file, you'll find that empty line in the end as well. (data/coco.names)
I tried removing the empty line and change the [:-1] to [:], but somehow the evaluation gets stuck and not working. It's really weird. But anyways, it should be working with this fix.