Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gitgithan opened this issue Feb 10, 2023 · 1 comment

Comments

@gitgithan
Copy link

gitgithan commented Feb 10, 2023

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.

@gitgithan gitgithan 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 Feb 10, 2023
@havardox
Copy link

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

manavrmoorthy pushed a commit to manavrmoorthy/Practical-Deep-Learning-Book that referenced this issue Aug 28, 2023
- removing deprecated files
- the gcloud sessions are not using the same runtime (so we need to re-download data) so writing outputs to gdrive to make sure things are running and outputs are accessible for subsequent notebooks in colab
- renaming 4/1 notebook - since it had underscores instead of hyphens, the colab link in the notebook was not working
- xception added to imports for notebook 1, since it is part of the model_maker
- PracticalDL#163 - fixed
- PracticalDL#164 - fixed
- PracticalDL#169 - fixed
- metric='angular' added for annoy as default arg will be removed in subsequent releases
- removing a duplicate PCA + Annoy section
- PracticalDL#170 - fixed
- time is a negligible factor here, and we do not need it in the plots (since we are using optimised accuracy calculation using numpy from issue 170) - hence, modifying the plots
- removing matplotlib.style.use('seaborn') since it is deprecated
- the final fine-tuning notebook uses Caltech256 features (as per the book), which do not exist, since fine-tuning was done on Caltech101 - hence, renaming those files to caltech101. Can we retain caltech101 to test?
- PracticalDL#167 - fixed, if the above is okay
- formatted the code

chapter 5:
- write_grads and batch_size params have been removed from callback, or will be removed in subsequent releases
- PracticalDL#174 - not able to replicate this issue
- added a pointer to the notebook that suggests that for tensorboard to work without a 403 Forbidden error on Colab, cookies need to be allowed (I faced this issue)
- notebook 3 in chapter 5 is the exact same as notebook 2 in chapter 2 - replaced the file directly
- the autokeras notebook in Colab is named autokeras-error.ipynb - where can we change this to autokeras.ipynb?
- fixing accuracy score calculation in the autokeras notebook
- formatted the code

chapter 6:
- including the download_sample_image function
- formatted the code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants