VIS-VAR / LGSC-for-FAS

Learning Generalized Spoof Cues for FaceAnti-spoofing
MIT License
225 stars 56 forks source link

Best_model.pdparams #36

Open naserpiltan opened 3 years ago

naserpiltan commented 3 years ago

Hello and thank you for sharing this code. I would like to train this repo on my own dataset. I downloaded the resnet18-5c106cde.pth and converted it to this paddle's model : resnet18-torch.pdparams. I put this weight file in the pretrained folder and seems everything is ok. But when I run the train.py file , I have this error
RuntimeError: Parameter file [ ./work_dir/ff_c23/Best_model.pdparams ] not exists What is the problem ? Thanks in advance.

mortezagolzan commented 2 years ago

Hello and thank you for sharing this code. I would like to train this repo on my own dataset. I downloaded the resnet18-5c106cde.pth and converted it to this paddle's model : resnet18-torch.pdparams. I put this weight file in the pretrained folder and seems everything is ok. But when I run the train.py file , I have this error RuntimeError: Parameter file [ ./work_dir/ff_c23/Best_model.pdparams ] not exists What is the problem ? Thanks in advance.

Hi I have the same issue. did you able to solve it?!

giangnd1808 commented 2 years ago

You can remove all code in fuction init_model() of runner.py and replace by pass when you train: def init_model(): pass


Từ: morteza golzan @.> Đã gửi: 28 Tháng Bảy 2021 2:08 SA Đến: VIS-VAR/LGSC-for-FAS @.> Cc: Nguyen Duc Giang 20172523 @.>; Comment @.> Chủ đề: Re: [VIS-VAR/LGSC-for-FAS] Best_model.pdparams (#36)

Hello and thank you for sharing this code. I would like to train this repo on my own dataset. I downloaded the resnet18-5c106cde.pth and converted it to this paddle's model : resnet18-torch.pdparams. I put this weight file in the pretrained folder and seems everything is ok. But when I run the train.py file , I have this error RuntimeError: Parameter file [ ./work_dir/ff_c23/Best_model.pdparams ] not exists What is the problem ? Thanks in advance.

Hi I have the same issue. did you able to solve it?!

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/VIS-VAR/LGSC-for-FAS/issues/36#issuecomment-887763298, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQY7X3TQ6JFZJZ2HJNJXQUTTZ372PANCNFSM436PPRSQ.

mortezagolzan commented 2 years ago

You can remove all code in fuction init_model() of runner.py and replace by pass when you train: def init_model(): pass ____ Từ: morteza golzan @.> Đã gửi: 28 Tháng Bảy 2021 2:08 SA Đến: VIS-VAR/LGSC-for-FAS @.> Cc: Nguyen Duc Giang 20172523 @.>; Comment @.> Chủ đề: Re: [VIS-VAR/LGSC-for-FAS] Best_model.pdparams (#36) Hello and thank you for sharing this code. I would like to train this repo on my own dataset. I downloaded the resnet18-5c106cde.pth and converted it to this paddle's model : resnet18-torch.pdparams. I put this weight file in the pretrained folder and seems everything is ok. But when I run the train.py file , I have this error RuntimeError: Parameter file [ ./work_dir/ff_c23/Best_model.pdparams ] not exists What is the problem ? Thanks in advance. Hi I have the same issue. did you able to solve it?! — You are receiving this because you commented. Reply to this email directly, view it on GitHub<#36 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQY7X3TQ6JFZJZ2HJNJXQUTTZ372PANCNFSM436PPRSQ.

Thank you for your response. Actually, I found out that 'load_from' property from checkpoint_cfg dict in train.py file, loads the best model even if you have not trained the model previously. Therefore changing its value from './work_dir/ff_c23/Best_model' to None in your first train solves this problem. Moreover, your answer works in the same way. Thanks again.