yijingru / BBAVectors-Oriented-Object-Detection

[WACV2021] Oriented Object Detection in Aerial Images with Box Boundary-Aware Vectors
MIT License
462 stars 87 forks source link

when turn resnet101 to resnet18 and resnet34 in ctrbox_net.py(line13), got problem!! #134

Open fish-kong opened 1 year ago

fish-kong commented 1 year ago

RuntimeError: Given groups=1, weight of size [1024, 2048, 3, 3], expected input[8, 512, 32, 32] to have 2048 channels, but got 512 channels instead

fish-kong commented 1 year ago

only could support resnet50 when i do change nothing esle parameters.

yijingru commented 1 year ago

Because resnet101 and resnet50 both share the same output channel 2048. To apply resnet18, you may change the channels here https://github.com/yijingru/BBAVectors-Oriented-Object-Detection/blob/11dad9aefab65f68f9330824980ee0c08bdb7234/models/ctrbox_net.py#L14 For example:

  self.dec_c2 = CombinationModule(128, 64, batch_norm=True)
  self.dec_c3 = CombinationModule(256, 128, batch_norm=True)
  self.dec_c4 = CombinationModule(512, 256, batch_norm=True)

(note channel is related with resnet layer1-4, you may test it first) https://github.com/yijingru/BBAVectors-Oriented-Object-Detection/blob/11dad9aefab65f68f9330824980ee0c08bdb7234/models/resnet.py#L211