I'm using MNIST example with 60000 training image and 10000 testing image. How do I find which of the 10000 testing image that has an incorrect classification/prediction?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Simply use model.predict_classes()
and compare the output with true labes. i.e:
incorrects = np.nonzero(model.predict_class(X_test).reshape((-1,)) != y_test)
to get indices of incorrect predictions
回答2:
To identify the image files that are wrongly classified, you can use:
imagenames = test_generator.filenames
errors = np.where(y_pred != test_generator.classes)[0]
for i in errors:
print(fnames[i])