Skip to content

keras.layers.UpSampling2D bilinear channel first bug #21401

Open
@tristandb8

Description

@tristandb8

import tensorflow as tf
import keras
from keras.src import ops

keras.backend.set_image_data_format('channels_first')

x = tf.zeros((3, 12, 224, 224))

output_upsampling_layer = keras.layers.UpSampling2D(size=(2, 2), interpolation="bilinear")(x)
output_bilinear_resize_only = ops.image.resize(x, (448, 448), interpolation="bilinear")

results in:
output_upsampling_layer shape: (3, 448, 224, 448)
output_bilinear_resize_only shape (3, 12, 448, 448)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions