divamgupta / image-segmentation-keras

Implementation of Segnet, FCN, UNet , PSPNet and other models in Keras.
https://divamgupta.com/image-segmentation/2019/06/06/deep-learning-semantic-segmentation-keras.html
MIT License
2.92k stars 1.16k forks source link

Custom Augmentation: AttributeError: 'Compose' object has no attribute 'to_deterministic' #388

Open jjohn485 opened 2 years ago

jjohn485 commented 2 years ago

Hi, I've been really impressed by all of your work so far! It has been working great for me except for this one error. When I try to create a custom augmentation for my images and masks, I keep receiving an error saying AttributeError: 'Compose' object has no attribute 'to_deterministic'. I'm not sure what the issue is. Any help would be greatly appreciated!

from imgaug import augmenters as iaa

def custom_augmentation(): return iaa.Sequential( [

apply the following augmenters to most images

        iaa.Fliplr(0.5),  # horizontally flip 50% of all images
        iaa.Flipud(0.5), # horizontally flip 50% of all images
    ])

model.train( train_images = images_train_full_dir, train_annotations = annotations_train_full_dir, val_images = images_prepped_val_dir, val_annotations = annotations_prepped_val_dir, validate = True, checkpoints_path = "/tmp/vgg_unet_1" , steps_per_epoch = 25, batch_size = 8, preprocessing = normalization, epochs=5, callbacks = callbacks, do_augment=True, # enable augmentation custom_augmentation=custom_augmentation )