Skip to content

Commit 1adaaec

Browse files
authored
Add build method to supress warning (#20729)
1 parent 881d8da commit 1adaaec

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

keras/src/layers/preprocessing/image_preprocessing/random_color_jitter.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,19 @@ def __init__(
112112
seed=self.seed,
113113
)
114114

115+
def build(self, input_shape):
116+
if self.brightness_factor is not None:
117+
self.random_brightness.build(input_shape)
118+
119+
if self.contrast_factor is not None:
120+
self.random_contrast.build(input_shape)
121+
122+
if self.saturation_factor is not None:
123+
self.random_saturation.build(input_shape)
124+
125+
if self.hue_factor is not None:
126+
self.random_hue.build(input_shape)
127+
115128
def transform_images(self, images, transformation, training=True):
116129
if training:
117130
if backend_utils.in_tf_graph():

0 commit comments

Comments
 (0)