Amshaker / SwiftFormer

[ICCV'23] Official repository of paper SwiftFormer: Efficient Additive Attention for Transformer-based Real-time Mobile Vision Applications
236 stars 25 forks source link

cannot reproduce the fast mlmodel #3

Closed YingkunZhou closed 1 year ago

YingkunZhou commented 1 year ago

I download the mlmodel which mentioned in Readme and also use almost the same environment to convert pytorch model to mlmodel

image

the left is mine, the right is downloaded from https://drive.google.com/file/d/1tZVxtbtAZoLLoDc5qqoUGulilksomLeK/view?usp=sharing

here is the layer distribution diff

image

and here is the performance diff

image
Amshaker commented 1 year ago

Hi,

Please change this boolean "CoreMLConversion" in swiftformer.py to True before converting your model to mlmodel. The normalization layer is currently not supported by coreml and this boolean disables this layer. I raised an issue into coreml and hopefully they support it soon.

Please let me know if you still not be able to reproduce the same performance.

Best regards, Abdelrahman.

YingkunZhou commented 1 year ago

oh I see, thanks.