I have set the dataloader value thus:

dataload=dataset3D(csv_file, data_dir,transform=None)

dataloader = torch.utils.data.DataLoader(dataload, batch_size=20,
                                            shuffle=True, num_workers=6)

I only have a single gpu at my disposal, when i set the num_workers=6 the model take 10992 Mb of GPU, and when num_workers=0 its only 6000Mb of GPU. I am assuming that this is because its batching the data loader into 6 and running 6 data sets through the model at the same time, which means that i am multiprocessing the whole model and not just the dataloader by placing the “def train()” command inside the “if name == ‘main’:” section.