Closed robertatdm closed 6 months ago
Solved the issue, by specifying the dtype
argument for the resizing layer to be tf.float32
.
resizing_layer = kcv.layers.Resizing(
height=480,
width=640,
bounding_box_format='xywh',
pad_to_aspect_ratio=True,
name="aug_resizing",
dtype=tf.float32 # <-- Manually specify dtype, so the layer further computes in float32
)
Should this bug be closed?
@robertatdm,
Sure, Please go ahead and close this issue.
Current Behavior:
The keras_cv.layers.Resizing layer seems to have problems with mixed precision. The following code snippet only works if we don't set the
mixed_precision
policy.Expected Behavior:
The following code should work without mixed_precision and with mixed_precision enabled. The snippet works, if it outputs
(480, 640, 3)
.Steps To Reproduce:
Version:
Tensorflow version: 2.15.1 Keras version: 2.15.0 Keras-CV version: 0.8.2