detectron2_backbone icon indicating copy to clipboard operation
detectron2_backbone copied to clipboard

efficientnet with FPN can not be run

Open lucasjinreal opened this issue 4 years ago • 4 comments
trafficstars

efficient output shape are:

EEE:  0 torch.Size([4, 16, 512, 400])
EEE:  1 torch.Size([4, 24, 256, 200])
EEE:  2 torch.Size([4, 80, 64, 50])
EEE:  3 torch.Size([4, 112, 64, 50])

this is impossible to run on FPN......

lucasjinreal avatar Jul 02 '21 08:07 lucasjinreal

detectron2/detectron2/modeling/backbone/fpn.py", line 142, in forward
    prev_features = lateral_features + top_down_features
RuntimeError: The size of tensor a (50) must match the size of tensor b (100) at non-singleton dimension 3

with config:



  BACKBONE:
    NAME: "build_efficientnet_fpn_backbone"
  EFFICIENTNET:
    NAME: "efficientnet_b1"
    # OUT_FEATURES: ["stride8", "stride16", "stride32"] # fpn produce 4 levels, only using 3 for now
    OUT_FEATURES: ["stride4", "stride8", "stride16", "stride32"]
  FPN:
    # IN_FEATURES: ["stride8", "stride16", "stride32"]
    IN_FEATURES: ["stride4", "stride8", "stride16", "stride32"]
    OUT_CHANNELS: 64
    REPEAT: 3

lucasjinreal avatar Jul 02 '21 09:07 lucasjinreal

detectron2/detectron2/modeling/backbone/fpn.py", line 142, in forward
    prev_features = lateral_features + top_down_features
RuntimeError: The size of tensor a (50) must match the size of tensor b (100) at non-singleton dimension 3

with config:

  BACKBONE:
    NAME: "build_efficientnet_fpn_backbone"
  EFFICIENTNET:
    NAME: "efficientnet_b1"
    # OUT_FEATURES: ["stride8", "stride16", "stride32"] # fpn produce 4 levels, only using 3 for now
    OUT_FEATURES: ["stride4", "stride8", "stride16", "stride32"]
  FPN:
    # IN_FEATURES: ["stride8", "stride16", "stride32"]
    IN_FEATURES: ["stride4", "stride8", "stride16", "stride32"]
    OUT_CHANNELS: 64
    REPEAT: 3

Hi @jinfagang, Have you solved the issue? I'm facing the same problem. Thanks!

channingmonk avatar Oct 21 '21 14:10 channingmonk

Same here. Any solutions?

JanGlinko avatar Feb 08 '22 10:02 JanGlinko

我也遇到了,请问解决了吗?

zhuzhu512 avatar Apr 12 '22 16:04 zhuzhu512