'Extract misclassified images using CNN keras
I am having difficulties extracting misclassified images, I tried to use the following line of code:
inc= np.nonzero(model.predict_classes(test_data).reshape(-1,))
print (inc)
but this doesn't work, can somebody help me? i would like to use the images in a research paper.
Solution 1:[1]
Vaelin,
your code will only give you indices of the misclassified objects. To get the object themselves you should apply the index to the objects array. It will look somewhat like this:
misclasssified_objs = test_data[inc]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Poe Dator |