- def forward(self, x, skip, concat=True):
- if x.size()[1] != 320:
- # out = F.interpolate(
- # x,
- # size=(skip.size(2), skip.size(3)),
- # mode="bilinear",
- # align_corners=False)
- upsample = nn.Upsample(size=(skip.size(2), skip.size(3)), mode='nearest')
- out = upsample(x)
- else:
- out = self.deconv(x)
- # self.deconv.weight.data(3, 3, 4)
- # out = self.deconv(x)
- print('after upsample', out.size(),skip.size(2), skip.size(3))
- if concat:
- out = torch.cat([out, skip], 1)
- print('upsample concat', out.size(), skip.size(2), skip.size(3))
- return out
复制代码
Zen 发表于 2020-7-8 16:59
你试试直接pytorch导出pt模型,然后转rknn?
upsample用nearest我记得是没啥问题的 ...
欢迎光临 Toybrick (https://t.rock-chips.com/) | Powered by Discuz! X3.3 |