I have written a custom dataloader to fetch the data and labels. I am training my deep learning model with different hyperparameter values. But one thing I notice is that if I run multiple programs, each with different hyperparameter values, on the same GPU (with same GPU usage, batch size etc…), both the program slows down by atleast 2X. Is there any particular reason for this? I am thinking it might be because of multiple loader instances? Here is a very general template of how my loader looks like.
class CustomLoader:
def __init__(self) -> None:
super().__init__()
self.all_files = []
self.all_labels = []
def get_all_files(self):
//returns all image file paths and its corresponding labels
def __len__(self):
return len(self.all_files)
def __getitem__(self, idx):
image = Image.open(self.all_files[idx])
label = self.all_labels[idx]
return image, label