Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Keras: Flow with Augmentation")
- datagen = ImageDataGenerator(rotation_range=30)
- start_time = time.time()
- datagen.fit(X_train)
- train_generator = datagen.flow(X_train, Y_train, batch_size=32)
- print("PRE-TIME (fit)", time.time() - start_time)
- start_time = time.time()
- step = 0
- for x_batch, y_batch in train_generator:
- step += 1
- if step > STEPS: break
- print("TIME", time.time() - start_time)
- curr_mem = psutil.virtual_memory().used
- print("Memory Used: %.2f GB" % ((curr_mem - start_mem) / GB))
- # Release unused memory
- gc.collect()
- time.sleep(5)
Add Comment
Please, Sign In to add comment