eea50f3869d720a0b4ae64960da11bc3bc59881c,train.py,,main,#,22

Before Change


    trainer = MultiprocessingTrainer(args, model, criterion)

    // Load the latest checkpoint if one is available
    epoch, batch_offset = trainer.load_checkpoint(os.path.join(args.save_dir, args.restore_file))

    // Train until the learning rate gets too small
    val_loss = None
    max_epoch = args.max_epoch or math.inf

After Change


    checkpoint_path = os.path.join(args.save_dir, args.restore_file)
    extra_state = trainer.load_checkpoint(checkpoint_path)
    if extra_state is not None:
        epoch = extra_state["epoch"]
        batch_offset = extra_state["batch_offset"]
        print("| loaded checkpoint {} (epoch {})".format(checkpoint_path, epoch))
        if batch_offset == 0:
            epoch += 1
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: elbayadm/attn2d
Commit Name: eea50f3869d720a0b4ae64960da11bc3bc59881c
Time: 2017-10-19
Author: myleott@fb.com
File Name: train.py
Class Name:
Method Name: main


Project Name: sony/nnabla-examples
Commit Name: 90cba3b5423dec1672af7e74c2ab9a67a8e658ad
Time: 2020-11-10
Author: Krishna.Wadhwani@sony.com
File Name: VAEs/vq-vae/main.py
Class Name:
Method Name: train