title: Keras data augmentation for Semantic Segmentation
body: <p>I am trying to implement data augmentation on both my image and mask for a semantic segmentation task as shown below. However, the ImageDataGenerator is able to read my images but it fails to read my masks. I am not sure where I am going wrong with this, it'll be great if someone can point out my mistake. Thanks in advance!</p>
  <pre><code>    data_gen_args = dict(rescale=1.0 / 255,
                           width_shift_range=0.1,
                           height_shift_range=0.1,
                           horizontal_flip=True)
      train_datagen = ImageDataGenerator(**data_gen_args)
      valid_datagen = ImageDataGenerator(rescale=1.0/255)
  
      seed = 1
      image_train_generator = train_datagen.flow_from_directory(
          directory=home_path,
          classes=[train_path],
          target_size=(256, 256),
          batch_size=32,
          class_mode=None,
          shuffle=True,
          seed=seed)
  
      mask_train_generator = train_datagen.flow_from_directory(
          directory=home_path,
          classes=[train_mask_path],
          target_size=(256, 256),
          batch_size=32,
          class_mode='input',
          color_mode='rgba',
          shuffle=True,
          seed=seed)
  
      image_val_generator = valid_datagen.flow_from_directory(
          directory=home_path,
          classes=[valid_path],
          target_size=(256, 256),
          batch_size=32,
          class_mode=None,
          shuffle=True,
          seed=seed)
  
      mask_val_generator = valid_datagen.flow_from_directory(
          directory=home_path,
          classes=[valid_mask_path],
          target_size=(256, 256),
          batch_size=32,
          class_mode='input',
          color_mode='rgba',
          shuffle=True,
          seed=seed)
  
  </code></pre>
  <p>This is the error message that I am getting:</p>
  <blockquote>
  <p>Found 3816 images belonging to 1 classes. <br>
  Found 0 images belonging to 1 classes. <br>
  Found 1272 images belonging to 1 classes. <br>
  Found 0 images belonging to 1 classes. <br></p>
  </blockquote>