Project 15: Image Channel Reshaper
ML Engineer
Builds on these lessons
Current Task
Objective
Convolutional layers expect a channel dimension even for grayscale images — tf.reshape() adds it before the data can flow into a CNN.
Task: reshape a batch of 28x28 images to add a single channel dimension and print the new shape.
index.py
import tensorflow as tf
images = tf.zeros([10, 28, 28])
reshaped = tf.reshape(images, [10, 28, 28, 1])
print(reshaped.shape)
* Hint: Correct characters turn green, incorrect ones turn red.
Live Preview
🖼️
Verify your code to see the preview