Skip to content

Calling Generic conv with data_format='NCHW' Leads to Segfault #8151

@cancan101

Description

@cancan101

Running on 1.0.0.2 Docker image, this code:

from tensorflow.python.ops import nn_ops
import tensorflow as tf
import numpy as np

images = np.ones((1,1,15,1)).astype(np.float32)
filters = 1 * np.ones((1,1,1,1), np.float32)

with tf.Session(''):
  output = nn_ops.conv2d(
      images,
      filters,
      strides=[1,1,1,1],
      padding='VALID',
      data_format='NCHW',
  ).eval()

yields:

F tensorflow/core/kernels/conv_ops.cc:65] Check failed: data_format == FORMAT_NHWC Generic conv implementation only supports NHWC te
nsor format for now.
Aborted (core dumped)

While it does print a helpful error message, it then proceeds to core dump.

I also see this issue on macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions