madpower2000 (16) [Avatar] Offline
#1
Listing 6.34 Preparing the training, validation, and test generators (the same source code at Listing 6.48 Preparing higher-resolution data generators for the Jena dataset).

Three generator function introduced: train_gen(), val_gen(), test_gen(), and all three based on generator() function.
But test_gen() is never used and as I suppose must be used in predict_generator(), but in this case, error will be raised, because our test_gen() will be return both features data and labels, and predict_generator() needs only features data.
256385 (46) [Avatar] Offline
#2
I believe it would be used in a call to evaluate_generator rather than predict_generator so it should be fine to yield the list
madpower2000 (16) [Avatar] Offline
#3
I suppose you keep to Chekhov's gun principle in coding smilie

"If in the first act you have hung a pistol on the wall, then in the following one it should be fired. Otherwise don't put it there."