PaddleSeg icon indicating copy to clipboard operation
PaddleSeg copied to clipboard

How do I use the pretrained Matting checkpoints for training?

Open tarunn2799 opened this issue 2 years ago • 0 comments

I've been training my own MODNet models on custom data, using the configs provided. How do I use the model checkpoint provided in the readme HERE as a starting point for my training?

Also, how should I change my training params if I'm using this as a checkpoint to start training? I currently use the default config for Modnet-hrnet18, and I get good results. Looking to make it better.

Final question : the HRNet backbone that is being used for modnet, is it pretrained on ImageNet or is it from scratch?

tarunn2799 avatar Aug 10 '22 12:08 tarunn2799

For the first question, you can add pretrained: path/to/xxxx.pdparams' of the model` in configs as following: image

Final question: It is pretrained on ImageNet.

May I ask, in what business do you use matting?

wuyefeilin avatar Aug 11 '22 06:08 wuyefeilin

Hi @wuyefeilin I did try doing that - I changed the outer pretrained key under the model key to the downloaded MODNet HR18 .pdparams file. But I got ValueError: paddle.load can not parse the file: <the downloaded file path>

Turns out the file was corrupted, and upon retrying it from scratch, it worked. Thank you. Can you help me understand if I should change the lr, optimizer and num_iters now since I'm using a pretrained model?

One more question : Will you guys be supporting the SOC adaptation strategy in MODNet within PaddleSeg anytime soon? Any idea how I can try that out with the trained models?

Your final question : I don't exactly use it for any business, personal use for my own learning and projects.

tarunn2799 avatar Aug 11 '22 07:08 tarunn2799

I download the modnet-hrnet_w18.pdparams form https://paddleseg.bj.bcebos.com/matting/models/modnet-hrnet_w18.pdparams can run normally. May be you can try again.

You can reduce the lr and num_iters if you using a pretrained model

We have not supported SOC. If you are interesting, may be you can use it on you unlabeled dataset by fix the loss module.

wuyefeilin avatar Aug 12 '22 03:08 wuyefeilin