5.4.2 Visualizing Convnets Filters - Be careful about the code samples in the e-book
About the sample codes in Section 5.4.2 - Visualizing the Convnets Filters (PP 170), if you write the exact codes as written in the e-book. Probably you cannot display those filter images correctly as displayed in the book. If the results are blank, please change the final line: "plt.imshow(results)" into "plt.imshow(results.astype('uint8'))"
When I wrote these codes in Spyder, the interpretor reported some hints: "Clipping input data to the valid range for imshow with RGB data([0..1] for floats or [0..255] for integers". However, the type of "results" is float64. Therefore, please change the data type when you want to visualize these filters.
I was stuck by this errors for one night and felt frustrated. Hope you guys won't! Thank you.
Thx, worked for me, could be a PR, if anybody cared...
plt.imshow(results.astype('uint8'))
@wzhings @ekkards I am having some problems with this code. When visualizing filters of the VGG16 (which is selected by default in the book), it works fine. The code provides outputs as expected. But when trying the same code on any other model, like 'cats_and_dogs_small_2' used in 'Visualizing intermediate activations', the outputs for all the layers and their filters seems same and meaningless.
I don't see any kind of pattern in those images. They are all alike and meaningless. Can you please help?
@fchollet Can you help please?
@ParikhKadam the author does not respond here. You need to help yourself.
@morenoh149 Ohk...
Thank you - saved me a lot of time. Worked!