An image in the Massachussets Road Dataset has dimensions (1500,1500,3) . where image_height = image_width = 1500 , and 3 is for RGB channels.
I used skimage.external.tifffile.imread for reading the images and then treid storing them in a numpy array having dimensions ((number_of_images),1500,1500,3) , which gave me a Memory Error.
For solutions, I looked at the PIL module which aids in reshaping the image to a smaller size but I was wondering whether that would cause me to lose some critical information.
Error Message
---------------------------------------------------------------------------
MemoryError Traceback (most recent call last)
<ipython-input-25-4133a180c798> in <module>()
200 if __name__ == '__main__':
201
--> 202 create_train_data()
203
204 create_test_data()
<ipython-input-25-4133a180c798> in create_train_data()
41
42
---> 43 imgs = np.ndarray((total, image_rows, image_cols,3), dtype=np.uint8)
44
45
MemoryError: