Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: index 13 is out of bounds for axis 0 with size 4 #2

Open
piscesdream opened this issue Dec 5, 2022 · 7 comments
Open

Comments

@piscesdream
Copy link

hello! 为什莫会出现这样的错误?我的是3分类,为什莫index会出现13。
Traceback (most recent call last):
File "test.py", line 397, in
test(opt.data,
File "test.py", line 236, in test
confusion_matrix.process_batch(predn, torch.cat((labels[:, 0:1], tbox), 1))
File "/root/yolo/yolov7_plate/utils/metrics.py", line 148, in process_batch
self.matrix[detection_classes[m1[j]], gc] += 1 # correct
IndexError: index 13 is out of bounds for axis 0 with size 4

@we0091234
Copy link
Owner

是不是最后一个epoch出现的

@piscesdream
Copy link
Author

单独跑test.py这个脚本出现的,训练时是最后出现的

@we0091234
Copy link
Owner

单独跑test.py这个脚本出现的,训练时是最后出现的

test.py 我还没改,你是要跑指标,结果吗?

@piscesdream
Copy link
Author

对,目前在绘制混淆矩阵会出现这个错误,其他暂无影响

@we0091234
Copy link
Owner

对,目前在绘制混淆矩阵会出现这个错误,其他暂无影响

好吧,我找个时间看看吧,最近挺忙的

@we0091234
Copy link
Owner

我改了一下,可以跑通,但是我两类,输出只有一类,奇怪
tmp699A

@we0091234
Copy link
Owner

对,目前在绘制混淆矩阵会出现这个错误,其他暂无影响

问题解决了,你重新拉取一下代码就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants