def read_data_from_LMDB(read_db, max_to_read=None):
    """Reads data from LMDB database and returns a list of entries in
    non-human readable form. To convert them to string, use Caffe's tools
    """
    data = []
    with read_db.begin() as txn:
        if max_to_read is None:
            max_to_read = txn.stat()['entries']
        cursor = txn.cursor()
        it = cursor.iternext(keys=False, values=True)
        for counter in range(max_to_read):
            if counter % 100000 == 0:
                print('Reading entry {}'.format(counter))
            data.append(it.item())
            it.next()
    read_db.close()
    return data
