Skip to content
Snippets Groups Projects
Commit 417132a7 authored by Carlos Vieira's avatar Carlos Vieira
Browse files

Make no of samples multiple of batch size

parent 17a90871
No related branches found
No related tags found
No related merge requests found
...@@ -505,8 +505,11 @@ datagen = ImageDataGenerator( ...@@ -505,8 +505,11 @@ datagen = ImageDataGenerator(
vertical_flip=False vertical_flip=False
) )
val_samples = int(x_train.shape[0] * 0.1)
# round up to nearest multiple of batch_size
val_samples += batch_size - (val_samples % batch_size)
x_train, x_val, y_train, y_val = train_test_split( x_train, x_val, y_train, y_val = train_test_split(
x_train, y_train, test_size=0.1) x_train, y_train, test_size=val_samples)
datagen.fit(x_train) datagen.fit(x_train)
convs = 1 convs = 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment