——感谢b站霹雳大佬 视频13-换backbone(不带FPN)_哔哩哔哩_bilibili
backbone = Mybackbone() # 自定义的backbone
# 获取backbone的输出通道数
out=backbone(torch.rand(1,3,224,224))
print(out["0"].shape) # eg为128
# 设置输出通道数
backbone.out_channels = 128
——感谢b站霹雳大佬 视频13-换backbone(不带FPN)_哔哩哔哩_bilibili
backbone = Mybackbone() # 自定义的backbone
# 获取backbone的输出通道数
out=backbone(torch.rand(1,3,224,224))
print(out["0"].shape) # eg为128
# 设置输出通道数
backbone.out_channels = 128
>