I'm just starting to learn about CNN (convolutional neural networks). Does the test data also need to be divided into batches, similar to how it's done with the training data?
Using batches is a “trick” for the numerical optimization of the neural network parameters. Once it comes time to predict on the test set, you are not trying to adjust the network parameters. You are just seeing what the fitted model predicts for a set of input images (or whatever your inputs are, but CNNs are classically used for images). The calculation is much simpler. You just have some function and evaluate that function at a point (such as an individual image), then move to the next point, then the next.
Perhaps this means that you are using batches of size one, but that really seems like the wrong philosophy to take: using batches instead of all of the data at once is to help the computer with the optimization.
If you can’t fit the entire test set into memory, then you will have to split it into chunks to make predictions. Perhaps these chunks are reasonably called “batches”.