class_correct[label] +=( c[i].item())
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
就是网络上最常用的测试每类数据集准确率的代码

找到一个外网ds遇到相似问题的评论,
correct seems to be a 0-dim tensor, which you cannot index. This error might be raised, as you are calling np.squeeze to create correct.
有没有xd会改的