pytorch-image-models icon indicating copy to clipboard operation
pytorch-image-models copied to clipboard

Support RepGhostNetV2 conv s/m/l, based on MobileNetV4, without weights though

Open ChengpengChen opened this issue 1 year ago • 4 comments

Build RepGhostNetV2 based on MobileNetV4.

Our RepGhostNetV2 differs to MobileNetV4 only in the shortcut connections.

As an alternative efficient backbone to MobileNetV4, RepGhostNetV2 has exactly the same parameters and FLOPs to MobileNetV4, and also achieves similar performance.

refer to: https://github.com/ChengpengChen/RepGhostNetV2

ChengpengChen avatar Jun 14 '24 09:06 ChengpengChen

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@ChengpengChen thanks, once I'm done/satisified with the remaining mobilenetv4 model trainings I'll see how these fair with comparable hparams.

FYI, if there is any reparameterization scheme to be deployed here, a fuse, reparameterize method can be added to the UniversalInvertedResidual block, the --reparam arg for val/benchmark/export scripts will recursively call any of those methods if they exist on model child modules.

https://github.com/huggingface/pytorch-image-models/blob/22de845add56865c3f8a9896f99104cb5abcaa11/timm/utils/model.py#L225

rwightman avatar Jun 14 '24 16:06 rwightman

@ChengpengChen thanks, once I'm done/satisified with the remaining mobilenetv4 model trainings I'll see how these fair with comparable hparams.

FYI, if there is any reparameterization scheme to be deployed here, a fuse, reparameterize method can be added to the UniversalInvertedResidual block, the --reparam arg for val/benchmark/export scripts will recursively call any of those methods if they exist on model child modules.

https://github.com/huggingface/pytorch-image-models/blob/22de845add56865c3f8a9896f99104cb5abcaa11/timm/utils/model.py#L225

Thanks!

Would be great if you help to compare these two networks.

Btw, RepGhostNetV2 is actually NOT a re-parameterized backbone like its V1 version, but built with the RepGhost bottlenecks (that's why it is called V2 ;) It is a MobileNetV4-like backbone, and they only differ in the shortcut connections. So, we may not have to add these fuse or reparameterize methods.

ChengpengChen avatar Jun 14 '24 16:06 ChengpengChen

@ChengpengChen started training a large @ 384x384 with exact hparams of the mnv4 conv-large I trained.

rwightman avatar Jun 24 '24 23:06 rwightman

@ChengpengChen started training a large @ 384x384 with exact hparams of the mnv4 conv-large I trained.

Hi, @rwightman Is there any update on the training results?

ChengpengChen avatar Jul 03 '24 05:07 ChengpengChen

@ChengpengChen got sidelined by a bit of time off the other week... so I did finish training the large, but it's ~ .5% or so behind the mnv4 equivalent, so around 82.5% instead of 82.95. There didn't appear to be any improved throughput or win to warrant the accuracy tradeoff

rwightman avatar Jul 08 '24 15:07 rwightman

@ChengpengChen got sidelined by a bit of time off the other week... so I did finish training the large, but it's ~ .5% or so behind the mnv4 equivalent, so around 82.5% instead of 82.95. There didn't appear to be any improved throughput or win to warrant the accuracy tradeoff

Sure, thanks for the info!

ChengpengChen avatar Jul 08 '24 15:07 ChengpengChen