xuebinqin / BASNet

Code for CVPR 2019 paper. BASNet: Boundary-Aware Salient Object Detection
MIT License
1.35k stars 249 forks source link

Retrain the existing model downgrade the performance. #7

Closed yaju1234 closed 4 years ago

yaju1234 commented 4 years ago

I want to re -train the basnet.pth model with my custom data set . I use the following code in the bastnet_train.py

model_dir_path = './saved_models/basnet_bsi/basnet.pth' net = BASNet(3, 1) net.load_state_dict(torch.load(model_dir_path)) if torch.cuda.is_available(): net.cuda()

I add the following line to load the existing model weights.
net.load_state_dict(torch.load(model_dir_path))

After training with my custom data set the model performance become down compare to the before re-train model . But working good with the similar type of data by which i re-train with. Please guide me.

xuebinqin commented 4 years ago

After training with my custom data set the model performance become down compare to the before re-train model .

Performance down on what dataset? If it becomes worse on the six datasets used in our paper, I think that's normal. Because the distribution of your custom dataset may different from the datasets used in our paper.

But working good with the similar type of data by which i re-train with.

That's reasonable. Because retraining the network actually pushes it to fit another distribution (your custom dataset), it should work well on your custom test data which should be similar to your training set.

On Mon, Aug 5, 2019 at 9:28 PM Yajneshwar Mandal notifications@github.com wrote:

I want to re -train the basnet.pth model with my custom data set . I use the following code in the bastnet_train.py

model_dir_path = './saved_models/basnet_bsi/basnet.pth' net = BASNet(3, 1) net.load_state_dict(torch.load(model_dir_path)) if torch.cuda.is_available(): net.cuda()

I add the following line to load the existing model weights. net.load_state_dict(torch.load(model_dir_path))

After training with my custom data set the model performance become down compare to the before re-train model . But working good with the similar type of data by which i re-train with. Please guide me.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NathanUA/BASNet/issues/7?email_source=notifications&email_token=ADSGORLY5PABH4ALOEQTOATQDDVXDA5CNFSM4IJSD4XKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HDQXUSA, or mute the thread https://github.com/notifications/unsubscribe-auth/ADSGORNTQZOAIYZZXHNZKM3QDDVXDANCNFSM4IJSD4XA .

-- Xuebin Qin PhD Candidate Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/

yaju1234 commented 4 years ago

Thanks for your replay . Is there any way to re-train the existing model with custom data set .Transfer learning.

xuebinqin commented 4 years ago

You're welcome.

What do you mean about the "existing model"? If you want to train BASNet without using the pre-trained weights, you can just comment net.load_state_dict(torch.load(model_dir_path)), then the network will be trained from scratch with your custom dataset. I suggest to re-train the model with your own dataset without using our provided weights if your dataset is not similar to what we used.

model_dir_path = './saved_models/basnet_bsi/basnet.pth' net = BASNet(3, 1)

net.load_state_dict(torch.load(model_dir_path))

if torch.cuda.is_available(): net.cuda()

On Mon, Aug 5, 2019 at 9:55 PM Yajneshwar Mandal notifications@github.com wrote:

Thanks for your replay . Is there any way to re-train the existing model with custom data set .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/NathanUA/BASNet/issues/7?email_source=notifications&email_token=ADSGORNHTKUTK6NIKTOIDVDQDDY4TA5CNFSM4IJSD4XKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3TX4IA#issuecomment-518487584, or mute the thread https://github.com/notifications/unsubscribe-auth/ADSGORN6V5MXIZTUWM6OF4TQDDY4TANCNFSM4IJSD4XA .

-- Xuebin Qin PhD Candidate Department of Computing Science University of Alberta, Edmonton, AB, Canada Homepage:https://webdocs.cs.ualberta.ca/~xuebin/