Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. x_train = x_train.reshape(-1, 28, 28, 1)
  2. x_test = x_test.reshape(-1, 28, 28, 1)
  3. x_train = x_train / 255
  4. x_test = x_test /255
  5.  
  6. from keras.preprocessing.image import ImageDataGenerator
  7. img_gen = ImageDataGenerator(
  8. rescale=1./255,
  9. horizontal_flip=False
  10. )
  11.  
  12. x_train = x_train.reshape(-1, 28, 28, 1)
  13. x_test = x_test.reshape(-1, 28, 28, 1)
  14.  
  15.  
  16. from keras.preprocessing.image import ImageDataGenerator
  17. img_gen = ImageDataGenerator(
  18. rescale=1./255,
  19. horizontal_flip=False
  20. )
  21.  
  22. History = Resnet34_model.fit_generator(img_gen.flow(x_train*255, y_train, batch_size = 16),
  23. steps_per_epoch = len(x_train)/16, validation_data = (x_test,y_test), epochs = 5 )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement