Figured that since the code was giving a possible of max 1TB so reduced it to a GB and it worked
So i have included this in the code
def write(self, images, labels = [] , max_data_map_size=1073741824):
## code ##
env = lmdb.open(self._lmdb_path, map_size = max(max_data_map_size, images.nbytes))
## atleast this will give a bit of flexibility
Figured that since the code was giving a possible of max 1TB so reduced it to a GB and it worked So i have included this in the code