-
Notifications
You must be signed in to change notification settings - Fork 19.4k
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
First training epoch slow? #6503
Comments
What's the format of your data (i.e. what kind of files are you loading it from, how does your generator function prepare it, etc.)? |
Thanks. The ImageDataGenerator is defined as train_datagen = ImageDataGenerator(
rescale=1. / 255,
rotation_range=20,
width_shift_range=0.2,
height_shift_range=0.2,
shear_range=0.2,
zoom_range=0.2,
fill_mode='nearest') and it loads the 256x256 PNG images as train_generator = train_datagen.flow_from_directory(
train_data_dir,
target_size=(64, 64),
batch_size=256, color_mode="grayscale",
class_mode='categorical') The model is fitted as history = model.fit_generator(
train_generator, steps_per_epoch=nb_train_samples // 256,
epochs=epochs, validation_data=validation_generator,
validation_steps=nb_validation_samples // 256, workers=12)
The model is fitted as Are the images stored in memory on the first pass? |
I am also experiencing the same issue with For 4096 samples:
|
the same issue |
The first epoch takes the same time, but the counter also takes into
account the time taken by building the part of the computational graph that
deals with training (a few seconds). This used to be done during the
`compile` step, but now it is done lazily one demand to avoid unnecessary
work. The switch happened maybe 1.5 years ago.
…On 16 October 2017 at 18:57, yyydido ***@***.***> wrote:
the same issue
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6503 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AArWb798zUvY9LbGnYj_i7ggTwOspMt3ks5stAmQgaJpZM4NQi9Y>
.
|
Thanks for the clarification! |
@fchollet Thanks |
When training various models with the
fit_generator
function andImageDataGenerator
, I experience that the first epoch takes much longer than subsequent ones. What is the reason for this?The text was updated successfully, but these errors were encountered: