Why is data_generator created inside the loop in classify?

It seems very odd to recreate the generator with a batch_size slice of the data on each trip through the loop, but that seems to be the desired approach. I get the same result if I create the data_generator with the full test set outside the loop and then just call next(dg) each time through the loop, which seems like the more idiomatic way to use a generator. (It even passes test_classify in spite of my having added a new line of code…)

Am I missing something?

Cheers - Jim

Agree with you, but this is not the only notebook that has awkward code…