Im trying to use custom dataset with the CocoDetection format, the cocoapi gives a succes on indexing and code passes but hangs when calling next()
train_dataset = datasets.CocoDetection(args.image_path, args.data_path, transform=coco_transformer())

querry_dataloader = data.DataLoader(train_dataset, sampler=sampler, batch_size=args.batch_size, drop_last=True, num_workers=0)

labeled_data = self.read_data(querry_dataloader)

labeled_imgs, labels = next(labeled_data) #Hangs here

with read_data() being as follows
def read_data(self, dataloader, labels=True):
        if labels:
            while True:
                for img, label, _ in dataloader:
                    yield img, label
        else:
            while True:
                for img, _, _ in dataloader:
                    yield img

The source code I’m trying to implement can be found here https://github.com/sinhasam/vaal 2
I’m also doing this in the Nvidia NGC pytorch container version 19.10 but the issue persists in the latest version.
Thanks in advance!