SHARE
TWEET

Untitled

a guest Jan 15th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print("Keras: Flow with Augmentation")
  2.  
  3. datagen = ImageDataGenerator(rotation_range=30)
  4.  
  5. start_time = time.time()
  6.  
  7. datagen.fit(X_train)
  8. train_generator = datagen.flow(X_train, Y_train, batch_size=32)
  9.  
  10. print("PRE-TIME (fit)", time.time() - start_time)
  11.  
  12. start_time = time.time()
  13.  
  14. step = 0
  15. for x_batch, y_batch in train_generator:
  16.     step += 1
  17.     if step > STEPS: break
  18.  
  19. print("TIME", time.time() - start_time)
  20.  
  21. curr_mem = psutil.virtual_memory().used
  22. print("Memory Used: %.2f GB" % ((curr_mem - start_mem) / GB))
  23.  
  24. # Release unused memory
  25. gc.collect()
  26. time.sleep(5)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top