bug fix: init model when no checkpoint was loaded
This commit is contained in:
parent
4882ff0c59
commit
152cfaac36
1 changed files with 3 additions and 0 deletions
|
@ -2594,6 +2594,9 @@ int main(int argc, char ** argv) {
|
||||||
|
|
||||||
printf("%s: init model\n", __func__);
|
printf("%s: init model\n", __func__);
|
||||||
bool existed = load_checkpoint_file(params.fn_checkpoint_in, &model, opt);
|
bool existed = load_checkpoint_file(params.fn_checkpoint_in, &model, opt);
|
||||||
|
if (!existed) {
|
||||||
|
init_model(&model);
|
||||||
|
}
|
||||||
set_param_model(&model);
|
set_param_model(&model);
|
||||||
|
|
||||||
opt->params = params.use_adam ? opt_params_adam : opt_params_lbfgs;
|
opt->params = params.use_adam ? opt_params_adam : opt_params_lbfgs;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue