I am loading the dataset using the default pytorch ImageFolder library. Can’t seem to pinpoint any issues here with the tensors.
def load_data(train_path,valid_path, batch_size, n_iters):
  train_dataset = datasets.ImageFolder(
      root=train_path,
      transform=transforms,
  )
  valid_dataset = datasets.ImageFolder(
      root=valid_path,
      transform=transforms,
  )

  epoch = n_iters/(len(train_dataset)/batch_size)
  epoch = int(epoch)
  print("Number of epoch {}".format(epoch))
  

  train_loader = torch.utils.data.DataLoader(
      train_dataset,
      batch_size = batch_size,
      shuffle = False
  )

  val_loader = torch.utils.data.DataLoader(
      valid_dataset,
      batch_size = batch_size,
      shuffle = False
  )

  print('\nTraining data info {}'.format(train_dataset))
  print('\nValid data info {}'.format(valid_dataset))

  # print('\n\nTrain set length {}'.format(train_set))
  # print('\nValidation set length {}'.format(val_set))

  print('\n\nTraining Batch loader size {}'.format(len(train_loader)))
  print('\nValidation Batch loader size {}'.format(len(val_loader)))

  return epoch, train_loader, val_loader