0
点赞
收藏
分享

微信扫一扫

IndexError: boolean index did not match indexed array along dimension 1; dimension is 32 but corresp

捡历史的小木板 2022-10-27 阅读 84


在cifar10实验中,期望找到指定标记的所有图像,

(x_train, y_train), (x_test, y_test)=datasets.cifar10.load_data()
print((x_train[y_train==5]).shape)

则会爆出如题错误。简言之,维度问题。通过以下更改:

print((x_train[y_train.reshape(-1)==5]).shape)


举报

相关推荐

0 条评论