Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on TPU notebooks #1

Open
isears opened this issue Mar 13, 2021 · 1 comment
Open

Not working on TPU notebooks #1

isears opened this issue Mar 13, 2021 · 1 comment

Comments

@isears
Copy link
Owner

isears commented Mar 13, 2021

There are reports of this library not working when running on a TPU.

@innat
Copy link

innat commented Dec 18, 2022

I used it inside a model and no issue when running on TPU (kaggle).
Works with GPU, TPU.

# Preprocessing
data_preprocessing = keras.Sequential(
    [
        Resizing(
            *INP_SIZE, 
            interpolation="bilinear"
        )
    ], 
    name='PreprocessingLayers'
)

# Augmentation
data_augmentations = keras.Sequential(
    [
        RandomCrop(*INP_SIZE),
        RandomFlip("horizontal"),
        RandomZoom(0.1, fill_mode='nearest'),
        RandomRotation(0.1, fill_mode='nearest'),
        CLAHE(
            tile_grid_size=(4, 4), clip_limit=3.0
        )
    ],
    name='AugmentationLayers'
)
model = keras.Sequential(
        [
            keras.layers.InputLayer(input_shape=INP_SIZE+(3,)),
            data_preprocessing,
            data_augmentations,
            applications.EfficientNetB0(include_top=False, pooling='avg'),
            ...
        ]
    )

One thing though, if I place CLAHE right after the Resize method, then there's a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants