tensorflow和pytorch二维卷积的数据格式

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Arctic_Beacon/article/details/86626259

官网

tensorflow:

https://tensorflow.google.cn/api_docs/python/tf/nn/conv2d

pytorch

https://pytorch.org/docs/master/nn.html?highlight=conv2d#torch.nn.Conv2d

区别如下:

tf.nn.conv2d(
    input,
    filter,
    strides,
    padding,
    use_cudnn_on_gpu=True,
    data_format='NHWC',
    dilations=[1, 1, 1, 1],
    name=None
)

NHWC 为:[batch, height, width, channels]

torch.nn.Conv2d(in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, bias=True)

In the simplest case, the output value of the layer with input size (N,C,H,W)and output (N,Cout,Hout,Wout)

猜你喜欢

转载自blog.csdn.net/Arctic_Beacon/article/details/86626259