예제 #1
0
def run():
    setup_imports()
    parser = flags.get_parser()
    args = parser.parse_args()
    trainer = build_trainer(args)

    # Log any errors that occur to log file
    try:
        trainer.load()
        trainer.train()
    except Exception as e:
        writer = getattr(trainer, "writer", None)

        if writer is not None:
            writer.write(e, "error", donot_print=True)
        if is_main_process():
            raise
예제 #2
0
def run():
    #print("Process ID is", os.getpid())
    #remote.install(verbose=False)
    #print("Sleep for a while, so that hunter can trace the process")
    #time.sleep(20)
    #print("Sleep done!")
    setup_imports()
    parser = flags.get_parser()
    args = parser.parse_args()
    pprint(args)
    trainer = build_trainer(args)

    # Log any errors that occur to log file
    try:
        trainer.load()
        trainer.train()
    except Exception as e:
        writer = getattr(trainer, "writer", None)

        if writer is not None:
            writer.write(e, "error", donot_print=True)
        if is_main_process():
            raise