Practical-Deep-Learning-Book
Practical-Deep-Learning-Book copied to clipboard
chapter-4/1_feature_extraction.ipynb using default batch size 32 instead of defined batch_size 128
batch_size = 128
datagen = tensorflow.keras.preprocessing.image.ImageDataGenerator(preprocessing_function=preprocess_input)
generator = datagen.flow_from_directory(root_dir,
target_size=(224, 224),
class_mode=None,
shuffle=False)
uses default batch_size = 32.
num_epochs = int(math.ceil(num_images / batch_size))
calculates 68 epochs based on 128 batch size.
So generator only generates 68*32 = 2176 images for feature_list, mismatching the 8677 in standard_feature_list with features extracted from the non generator method.
@PracticalDL This seems like a pretty big issue. The whole of chapter 4 uses the wrong number of training samples.