コード例 #1
0
                                         last_epoch=start_epoch)
        bnm_scheduler = pt_utils.BNMomentumScheduler(model,
                                                     bnm_lmbd,
                                                     last_epoch=start_epoch)

    model_fn = model_fn_decorator(nn.CrossEntropyLoss())

    # viz = pt_utils.VisdomViz(port=args.visdom_port)
    # viz.text(str(vars(args)))

    trainer = pt_utils.Trainer(
        model,
        model_fn,
        optimizer,
        checkpoint_name=
        "/kitti_semantic/Pointnet2_PyTorch-master/pointnet2/train/checkpoints/pointnet2_smeseg",
        best_name=
        "/kitti_semantic/Pointnet2_PyTorch-master/pointnet2/train/checkpoints/poitnet2_semseg_best",
        lr_scheduler=lr_scheduler,
        bnm_scheduler=bnm_scheduler
        # viz=viz
    )

    trainer.train(0,
                  start_epoch,
                  args.epochs,
                  train_loader,
                  test_loader,
                  best_loss=best_loss)

    if start_epoch == args.epochs:
        _ = trainer.eval_epoch(test_loader)
コード例 #2
0
            optimizer, lr_lbmd, last_epoch=start_epoch
        )
        bnm_scheduler = pt_utils.BNMomentumScheduler(
            model, bnm_lmbd, last_epoch=start_epoch
        )

    model_fn = model_fn_decorator(nn.CrossEntropyLoss())

    viz = pt_utils.VisdomViz(port=args.visdom_port)
    viz.text(str(vars(args)))

    trainer = pt_utils.Trainer(
        model,
        model_fn,
        optimizer,
        checkpoint_name="checkpoints/pointnet2_smeseg",
        best_name="checkpoints/poitnet2_semseg_best",
        lr_scheduler=lr_scheduler,
        bnm_scheduler=bnm_scheduler,
        viz=viz
    )

    trainer.train(
        0,
        start_epoch,
        args.epochs,
        train_loader,
        test_loader,
        best_loss=best_loss
    )

    if start_epoch == args.epochs: