按教程进行预训练报错:“finetune_exclude_pretrained_params”
按照官方教程(https://github.com/PaddlePaddle/models/tree/develop/PaddleCV/image_classification)进行预训练微调参数,训练自己的数据时需要滤掉最后的FC层报错:”train.py: error: unrecognized arguments: --finetune_exclude_pretrained_params=fc_offset,fc_weights“
错误很明显:官方的train.py代码中没有“finetune_exclude_pretrained_params”参数,请官方人员回复一下,如果没有这个参数,我做微调如何去掉最后一层的参数呢???
1)官方给的命令:
python train.py
--data_dir=./data/ILSVRC2012/
--total_images=1281167
--class_dim=1000
--validate=True
--model=ResNet50_vd
--batch_size=256 \
--lr=0.1
--num_epochs=200
--model_save_dir=output/
--l2_decay=7e-5
--pretrained_model=${path_to_pretrain_model}
--finetune_exclude_pretrained_params=fc_0.w_0,fc_0.b_0
2)我的命令: python train.py --model=DPN107 --data_dir=input_image/train_images --total_images=20580 --class_dim=120 --batch_size=30 --pretrained_model=models_parameters/pretrained_model/DPN107 --model_save_dir=models_parameters/training_model/DPN107 --finetune_exclude_pretrained_params=fc_offset,fc_weights
请更新代码~
请更新代码~
代码是官方的,谢谢
https://github.com/PaddlePaddle/models/blob/9b50a73c0281b2fa6c226cd1a0637108c51e7695/PaddleCV/image_classification/utils/utility.py#L102
最近models develop分支有更新,该参数已经加上了,请使用develop分支最新的代码
https://github.com/PaddlePaddle/models/blob/9b50a73c0281b2fa6c226cd1a0637108c51e7695/PaddleCV/image_classification/utils/utility.py#L102
最近models develop分支有更新,该参数已经加上了,请使用develop分支最新的代码
能否把 finetune_exclude_pretrained_params 这个改成 bool型的呢,意思试如果是True,则根据模型名称,自动exclude 对应的 参数,而不需要自动输入需要 排除的参数名称。
好的,谢谢你们哇。辛苦啦。
发送自 Windows 10 版邮件https://go.microsoft.com/fwlink/?LinkId=550986应用
发件人: Yibing Liu [email protected] 发送时间: Sunday, January 5, 2020 11:56:37 AM 收件人: PaddlePaddle/models [email protected] 抄送: LRY0111 [email protected]; Author [email protected] 主题: Re: [PaddlePaddle/models] 按教程进行预训练报错:“finetune_exclude_pretrained_params” (#4153)
https://github.com/PaddlePaddle/models/blob/9b50a73c0281b2fa6c226cd1a0637108c51e7695/PaddleCV/image_classification/utils/utility.py#L102
最近models develop分支有更新,改参数已经加上了,请使用develop分支最新的代码
― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/PaddlePaddle/models/issues/4153?email_source=notifications&email_token=AFUZSAUVN6LOESDMRQCKUGLQ4FK7LA5CNFSM4KCOG4DKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIDIBBI#issuecomment-570851461, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFUZSAUYPNRLKFQQCBFYWQ3Q4FK7LANCNFSM4KCOG4DA.
@chliang 这样可能不太灵活,exclude的参数只依赖于不同的模型,都变成固定的了
@chliang 这样可能不太灵活,exclude的参数只依赖于不同的模型,都变成固定的了
好的 谢谢