Skip to content

chapter-4/1_feature_extraction.ipynb using default batch size 32 instead of defined batch_size 128 #164

Open

Description

@gitgithan
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.

Activity

  1. changed the title [-]chapter-4/1_feature_extraction.ipynb using default batch size instead of defined variable[/-] [+]chapter-4/1_feature_extraction.ipynb using default batch size 32 instead of defined batch_size 128[/+] on Feb 10, 2023
  2. havardox commented on Aug 21, 2023

    @havardox

    @PracticalDL This seems like a pretty big issue. The whole of chapter 4 uses the wrong number of training samples.

  3. added a commit that references this issue on Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions