diff --git a/python/tvm/relay/frontend/keras.py b/python/tvm/relay/frontend/keras.py index 8c8a4a1ddcd3..8c26efffb4fc 100644 --- a/python/tvm/relay/frontend/keras.py +++ b/python/tvm/relay/frontend/keras.py @@ -370,6 +370,8 @@ def _convert_convolution(inexpr, keras_layer, etab, data_layout, input_shape=Non if data_layout == "NHWC": if is_depthconv: kernel_layout = "HWOI" + elif is_deconv: + kernel_layout = "HWOI" else: kernel_layout = "HWIO" else: diff --git a/tests/python/frontend/keras/test_forward.py b/tests/python/frontend/keras/test_forward.py index f39ca0662e5e..50fa97cbca5c 100644 --- a/tests/python/frontend/keras/test_forward.py +++ b/tests/python/frontend/keras/test_forward.py @@ -290,6 +290,17 @@ def test_forward_conv(self, keras_mod): keras_model = keras_mod.models.Model(data, x) verify_keras_frontend(keras_model) + def test_forward_conv_transpose(self, keras_mod): + """test_forward_conv_transpose""" + data = keras_mod.layers.Input(shape=(32, 32, 128)) + conv_funcs = [ + keras_mod.layers.Conv2DTranspose(filters=64, kernel_size=(2, 2), padding="valid"), + ] + for conv_func in conv_funcs: + x = conv_func(data) + keras_model = keras_mod.models.Model(data, x) + verify_keras_frontend(keras_model, layout="NHWC") + def test_forward_batch_norm(self, keras_mod): """test_forward_batch_norm""" data = keras_mod.layers.Input(shape=(32, 32, 3))