How to use other pre-trained model on unet_learner

(chang shuo) #1

Hello! I’m trying to use other pre-trained model on my training .
This is my code :

#succeed get a new pre-trained model ( RESNEXT WSL )

import torch
model = torch.hub.load(‘facebookresearch/WSL-Images’, ‘resnext101_32x8d_wsl’)
model.eval()

#use other pre-trained model on unet_learner
learn =unet_learner(data,pretrained=model, metrics=metrics)

Here,I want to use RESNEXT WSL which is a new pre-trained model of pytorch on my fastai segmentation code.But I don’t known how to use it on my fastai Unet segmentation code.

I ran this code
learn =unet_learner(data,pretrained=model, metrics=metrics)
and got a error on jupyter notebook :

TypeError Traceback (most recent call last)
in
----> 1 learn =unet_learner(data,pretrained=model, metrics=metrics)

TypeError: unet_learner() missing 1 required positional argument: ‘arch’

Thank you very much

0 Likes