Skip to content

Visualizing what convnets learn confusing indexing #2297

@jxu

Description

@jxu

Issue Type

Documentation Bug

Source

binary

Keras Version

3

Custom Code

No

OS Platform and Distribution

No response

Python version

No response

GPU model and memory

No response

Current Behavior?

AFAIK, Keras and TF index into images as (height, width, channels) (ignoring batch size)

So why does stitched_filters have shape (width, height, 3)? Same for indexing into the ndarray.

I think this indexing may be plotting the images with x,y swapped, unless keras.utils.save_img somehow changes the numpy indexing.

Standalone code to reproduce the issue or tutorial link

https://keras.io/examples/vision/visualizing_what_convnets_learn/

The code is from https://deeplearningwithpython.io/chapters/chapter10_interpreting-what-convnets-learn/

Similar issue I opened fchollet/deep-learning-with-python-notebooks#281

Relevant log output

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions