Skip to content

Instantly share code, notes, and snippets.

@virtualdvid
Created January 15, 2019 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virtualdvid/251dcd499b3dcc45c016339d72d7790f to your computer and use it in GitHub Desktop.
Save virtualdvid/251dcd499b3dcc45c016339d72d7790f to your computer and use it in GitHub Desktop.
load dataset
# Image Preprocessing
start_time = time.time()
dataset = Images('flowers', 'flowers', config=['resize=(128,128)', 'store'])
print("Preprocessing: ", int(time.time() - start_time), "secs")
print("Classes", dataset.classes, "Images:", dataset.count)
curr_mem = psutil.virtual_memory().used
print("Memory Used: %.2f GB" % ((curr_mem - start_mem) / GB))
# Extract dataset into memory
dataset.split = 0.0 # use the entire dataset
X_train, X_test, Y_train, Y_test = dataset.split
# Release unused memory
gc.collect()
time.sleep(5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment