nnabla-examples icon indicating copy to clipboard operation
nnabla-examples copied to clipboard

checkpoint of SLEGAN models

Open emanuelebalia opened this issue 3 years ago • 4 comments

Is implemented the way to save the chekpoints of the models in SLEGAN? The train.py need a --model-load-path but dont work with the GenIter.h5 file generated. There is a solution?

emanuelebalia avatar Jan 19 '22 15:01 emanuelebalia

If you run train.py all the way through, then it will save the checkpoints by default. I'm not sure why model-load-path is not working in your second question. Could you post the error message here? (By the way, train.py doesn't need to have --model-load-path argument. It'll just run from scratch if --model-load-path is not specified)

TE-andrewshin avatar Jan 20 '22 01:01 TE-andrewshin

Which are the checkpoint file and how I load its on the train.py? In general, there is no error, but the train start from scratch each time, even if I set some model-load-path

emanuelebalia avatar Jan 20 '22 01:01 emanuelebalia

I see. It actually looks like train.py is missing a part for loading checkpoints. We will update it asap.

In the mean time, you can do the following: Add the following lines after Line 68 of train.py,

    gen_param_path = args.model_load_path + "/Gen_xxx.h5"
    dis_param_path = args.model_load_path + "/Dis_xxx.h5"
    with nn.parameter_scope(scope_gen):
        nn.load_parameters(gen_param_path)
    with nn.parameter_scope(scope_dis):
        nn.load_parameters(dis_param_path)

TE-andrewshin avatar Jan 20 '22 02:01 TE-andrewshin

okok, I'll add it, thanks.

emanuelebalia avatar Jan 20 '22 02:01 emanuelebalia