
import argparse

from sdsvkie.cfg import load_cfg
from sdsvkie.engine.trainer import Trainer

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--cfg", type=str, default="sdsvkie/cfg/default.yaml")
    parser.add_argument("--device", type=str, default="cuda")
    parser.add_argument("--save_dir", type=str, default="./workdirs/exp")
    parser.add_argument("--wandb", action="store_true")
    

    args = parser.parse_args()
    # cfg = cfg2dict(args.cfg)
    # cfg['device'] = args.device
    # cfg['save_dir'] = args.save_dir
    cfg = load_cfg(args.cfg, vars(args))
    print(cfg)

    if args.wandb:
        cfg['wandb'] = "invoice"

    trainer = Trainer(cfg)
    trainer.train()

