pytorch与tensorflow网络输入图片通道在前在后(channel_first和channel_last)

首先,Tensorflow支持图像输入通道在前和通道在后的两种模式,而Pytorch只支持通道在前的输入模式:

Tensorflow supports two form of data as the input of its convolutional layer, channels first and channels last. In the first format, data are in the form of [N, C, H, W] where N is the batch size, C is the number of channels, H is the height of matrix and W is the width of matrix. In the second format, data are in the form of [N, H, W, C]. In PyTorch only channels first data format is supported.

在Tensorflow中可以设置进行两种模式的切换与选择,而在Pytorch中,如果是通道在后的话,就只能够对输入进行变换,可以参考:https://blog.csdn.net/qq_40877238/article/details/106024442

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值