question: Problem with dictionary of DataLoaders in training_step.
context: I followed the steps from the documentation when it comes to returning a dictionary of DataLoaders. The problems occurs in the training_step method. I expect the batch parameter to be a dictionary, but in reality it is a string, the first key of the expected dictionary.
  def train_dataloader(self):
      dl1 =  DataLoader(IconDataset(self.train_icons_path),batch_size=128,
                collate_fn=self.triplet_mining.batch_hard_negatives,num_workers=5)
      dl2 = DataLoader(IconDataset(self.train_icons_path),batch_size=128,
                collate_fn=self.triplet_mining.batch_semi_hard_negative,num_workers=5)
      return {
              "hard": dl1,
              "semi-hard": dl2 }
  
  In training_step
  def training_step(self,batch,batch_idx):
      print(type(batch))   # str
      print(batch)         # hard
  
  I don't know if there is a problem with my collate_fn method. The batching was working all right when one single DataLoader was used.
answer: It's so funny how fast one can find the answer to his own question. The problem was related to the validation DataLoaders. I was trying to return a dictionary in a similar manner to the training_dataloader, but the validation loop works with a sequence of DataLoaders. There is a similar question answered here: #8623