Guest User

Untitled

a guest
Jan 15th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. print("Gap: flow from directory")
  2.  
  3. start_mem = psutil.virtual_memory().used
  4. start_time = time.time()
  5.  
  6. dataset = Images(config=['stream'])
  7. dataset.load('flowers')
  8. dataset.minibatch = 32
  9. train_generator = dataset.minibatch
  10.  
  11. print("PRE-TIME", time.time() - start_time)
  12.  
  13. start_time = time.time()
  14.  
  15. step = 0
  16. for x_batch, y_batch in train_generator:
  17. step += 1
  18. if step > STEPS: break
  19.  
  20. print("TIME", time.time() - start_time)
  21.  
  22. curr_mem = psutil.virtual_memory().used
  23. print("Memory Used: %.2f GB" % ((curr_mem - start_mem) / GB))
  24.  
  25. # Release unused memory
  26. gc.collect()
  27. time.sleep(5)
Add Comment
Please, Sign In to add comment