1

I am using Imgaug for image augmentations on my training data. The code is as follows :

    training_augment = iaa.Sequential([iaa.Fliplr(0.5),
                                       iaa.Flipud(0.5),
                                       iaa.Sometimes(0.5, iaa.Rot90((1, 3))),
                                       iaa.Sometimes(0.25, iaa.Affine(rotate=(-30, 30),
                                                                      scale=(1.0, 1.25),
                                                                      translate_percent={"x": (-0.1, 0.1), "y": (-0.1, 0.1)},
                                                                      cval=1.0)),
                                       iaa.AdditiveGaussianNoise(loc=0, scale=(0.0, 0.2), per_channel=0.5)])

The following is the error :

ValueError: Got dtype 'float64', which is a forbidden dtype (uint32, uint64, uint128, uint256, int32, int64, int128, int256, float64, float96, float128, float256).

This error comes while using AdditiveGuassianNoise, while using the rest, it runs normally. I am not quite sure what the error means. If anyone could help out, it would be highly appreciated. Thanks

Have also added my Custom data generator code to where the images go to :

    def create_augmented_batch(self, index):  # call in the training images
        image_list, labels_batch = self._create_balanced_batch(index)
        if self.augmentation is not None:
            image_list = self.augmentation.augment(images=image_list)
        return image_list, labels_batch
    
    def __getitem__(self, index):
        if self.augmentation is None:
            images, labels = self.create_batch(index)  # for test images
        else:
            images, labels = self.create_augmented_batch(index)  # for training images
        return images[..., np.newaxis], tf.keras.utils.to_categorical(np.array(labels), num_classes=self.num_classes)

xivij
  • 25
  • 4
tammy
  • 43
  • 5

0 Answers0