Python Tensorflow自动编码器:当前的实现尚不支持批次和深度维度的跨步

Python Tensorflow自动编码器:当前的实现尚不支持批次和深度维度的跨步,python,tensorflow,autoencoder,Python,Tensorflow,Autoencoder,我正在尝试创建一个自动编码器-解码器框架。 下面是我正在使用的代码 # Define convolution layers def conv(layer_name, input_X, shape, strides, padding = "SAME"): with tf.variable_scope(layer_name): W = tf.get_variable("W", shape = shape, dtype=tf.float32) return tf

我正在尝试创建一个自动编码器-解码器框架。 下面是我正在使用的代码

# Define convolution layers
def conv(layer_name, input_X, shape, strides, padding = "SAME"):
    with tf.variable_scope(layer_name):
        W = tf.get_variable("W", shape = shape, dtype=tf.float32)
        return tf.nn.conv2d(input_X, W, strides, padding), W

# Layer1 convolution
encoder_layer1, W1 = conv("encode_layer1", X, [28, 28, 1, 10], [2,2,2,2])
我得到下面的错误

InvalidArgumentError (see above for traceback): Current implementation does not yet support strides in the batch and depth dimensions.
     [[Node: encode_layer1/Conv2D = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], padding="SAME", strides=[2, 2, 2, 2], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_X_0_0, encode_layer1/W/read)]]
请参见以下内容:

必须具有步幅[0]=步幅[3]=1。对于相同水平和顶点步长的最常见情况,步长=[1,步长,步长,1]

步幅[0]是批次维度,步幅[3]是通道(或深度)维度

尝试将跨步设置为[1,2,2,1]