I have an answer for the second question, how the batches in the dataset and the batch_size
parameter in the fit
function interact. Per the documentation of fit
:
Do not specify the batch_size if your data is in the form of datasets, generators, or keras.utils.Sequence instances (since they generate batches).
So the fit
function will take the batches straight from the input pipeline. Specify one or the other but not both. Specifying the batch size in the input pipeline, presumably permits optimizations upstream. This makes it also a partial answer to the first question. Still, I'm curious if someone has a better explanation.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…