Skip to content

Conv1d throws an error when using 'channels_first' data format #15178

@MoayedHajiAli

Description

@MoayedHajiAli

System information.

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Amazon EC2
  • TensorFlow installed from (source or binary): source
  • TensorFlow version (use command below): 2.5.0
  • Python version: 3.6.13
  • tested on CPU

Describe the problem.
calling a Conv1D layer with the channels first data format throws an error of

The Conv2D op currently only supports the NHWC tensor format on the CPU. The op was given the format: NCHW [Op:Conv2D]

This error is not present when using 'channels_last' data format and produce the expected behavior. The issue is also present in the Conv2d layers.

Standalone code to reproduce the issue.
K.layers.Conv1D(10, 3, data_format='channels_first')(tf.random.normal((10, 3, 10), dtype=tf.float32))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions