That’s one of the first things I tried, didn’t help.
I also modified the code to require only pytorch, so it might be easier to run now:
#!/usr/bin/env python
import os, errno
import glob
import argparse
import random
# import sqlite3

from torch.utils.data import Dataset, DataLoader


parser = argparse.ArgumentParser()
parser.add_argument('-n', '--number-of-db-lines')
parser.add_argument('-e', '--makeError', action='store_true')
parser.add_argument('-ee', '--makeError2', action='store_true')
parser.add_argument('-bss', '--batch-size-of-sample', type = int, default = 6000)
parser.add_argument('-b', '--db-batch-size', type = int, default = 1e6)
parser.add_argument('-s', '--sequence-read-length', type = int, default = 50)
args = parser.parse_args()


######################
###################### Code for creating temp sqlite database for testing
######################

# def remove_file_if_exist(filename):
#     try:
#         os.remove(filename)
#     except OSError as e: 
#         if e.errno != errno.ENOENT: 
#             raise 
# def write_to_db(values_batch, con):
#     con.executemany('INSERT INTO `sequences` (read) VALUES(?)', values_batch)
#     con.commit()
# def create_sqlite3_db():
#     temp_db_name = "temp_db_for_test.db"
#     remove_file_if_exist(temp_db_name)
#     print("Creating file:",  temp_db_name)
#     con = sqlite3.connect(temp_db_name)
#     create_table_cmd = [    'CREATE TABLE IF NOT EXISTS ',
#                 "sequences",
#                 '(',
#                 'read BLOB',
#                 ')']
#     con.execute(''.join(create_table_cmd))
#     values_batch = []
#     i = 0
#     for line in range(int(args.number_of_db_lines)):
#         i += 1
#         values_batch.append([   "Db_line_"+str("ASDFASF"*10)+str(line)])
#         if values_batch and i % args.db_batch_size == 0:
#             print(".", end="", flush=True),
#             write_to_db(values_batch, con)
#             values_batch = []
#     print(str(i), 'reads processed')
#     write_to_db(values_batch, con)
#     con.close()



######################
###################### Code for dataset
######################

class Multi_line_Dataset(Dataset):

    def __init__(self, batch_size_of_sample, sequence_read_length, makeError, makeError2):
        self.batch_size_of_sample = batch_size_of_sample
        self.makeError = makeError
        self.makeError2 = makeError2
        self.sequence_read_length = sequence_read_length
        # self.db_filename_list = ["temp_db_for_test.db"]

    def __len__(self):
        return int(args.number_of_db_lines)//int(self.batch_size_of_sample)

    def __getitem__(self, idx):
        # ## getting bunch of lines from the sqlite DB
        # bd_file_name = self.db_filename_list[0]
        # temp_db_connection = sqlite3.connect(bd_file_name)
        # temp_group_of_samples = random.sample(range(1, int(args.number_of_db_lines)), int(args.batch_size_of_sample))
        # query = "SELECT * FROM sequences where rowid IN (%s)" % ','.join(str(v) for v in temp_group_of_samples)
        # readstrs = temp_db_connection.execute(query).fetchall()
        # temp_db_connection.close()

        values_batch = []
        for line in range(int(args.batch_size_of_sample)):
            values_batch.append([   "Db_line_"+str("ASDFASF"*10)+str(line)])

        ## processing each line we got from the DB
        processed_read_sequences = []
        for read_string in values_batch:
            sequence = read_string[0][:-1][0:self.sequence_read_length]
            SomeNewSequence = [0]*len(sequence) 
            # doing somehting
            # doing somehting
            # doing somehting
            # doing somehting
            if (self.makeError):

                processed_read_sequences.append(SomeNewSequence)
            else:
                pass
        if (self.makeError2):
            return processed_read_sequences
        else:
            return read_string
    



if __name__ == '__main__':
    # create_sqlite3_db()
    ML_dataset = Multi_line_Dataset(batch_size_of_sample=args.batch_size_of_sample, sequence_read_length=args.sequence_read_length, makeError=args.makeError , makeError2=args.makeError2 )
    dataloader = DataLoader(ML_dataset, batch_size=16,
                            shuffle=True, num_workers=1, pin_memory = True)
    print("")
    print("Getting batches")
    for i_batch, sample_batched in enumerate(dataloader):
        print(".", end="", flush=True),
    print("")
    # remove_file_if_exist("temp_db_for_test.db")
    print("Finished without errors")