How to use EfficientNet with unet_learner as encoder in FastAI V2?

Hi,

I am trying to train a unet_learner with EfficientNet backbone? I found an excellent online blog on integrating EfficientNet from timm into FastAI for classification task where EfficientNet is extracted and a head is added to it and then used within the Learner class.

Can it be used with the FastAI v2 unet_learner? If yes, how I can achieve this integration?

Thanks in advance.
Bilal

1 Like

There was a PR into my wwf resource but the docs don’t quite render yet. See here: walkwithfastai.github.io/02_vision.external.timm.ipynb at master · walkwithfastai/walkwithfastai.github.io · GitHub

Note: it’s the same notebook. Look a bit further down

3 Likes

Thank you @muellerzr. This is what I needed. Cool.

Thanks, it is very helpful!!

I was wondering how the network can handle a more complex encoder like EfficientNetB4, despite the decoder only being made up of 3 blocks.

Dear @Redevil,

Fastai dynamic unet take care of decoder by itself and so does other libraries. I ended up using Pytorch semantic segmentation library with fastai where more encoder options are available including ViTs.

1 Like