
04 · Reshape and Transpose Real Images
Part III, Block 2 of Tensors for Machine Learning. One idea that prevents many silent bugs:
Changing a tensor’s shape is not the same as moving its axes.
Microscopes and cameras order their axes according to the hardware, not according to what a model expects. Getting this wrong does not crash — the model runs on scrambled data and returns confident, meaningless output. In a drug screen, that is a wrong decision about whether a compound works. The famous version in tech: a model trained in TensorFlow (NHWC) deployed into PyTorch (NCHW) with no transpose.
Study here, then run the real thing: notebook 04 on Colab · the handbook · workshop home
Built from the workshop’s own material by Ravi Kalia and Sebastian Laverde Chunza, CC BY 4.0.
7 topics2 tags