Exemple #1
0
def main(_):
    utils.set_gpus_to_use()

    try:
        import include.tensorvision.train
    except ImportError:
        logging.error("Could not import the submodules.")
        logging.error("Please execute:"
                      "'git submodule update --init --recursive'")
        exit(1)

    with open(tf.app.flags.FLAGS.hypes, 'r') as f:
        logging.info("f: %s", f)
        hypes = json.load(f)

    #print(hypes)

    if 'TV_DIR_RUNS' in os.environ:
        os.environ['TV_DIR_RUNS'] = os.path.join(os.environ['TV_DIR_RUNS'],
                                                 'KittiBox')

    utils.set_dirs(
        hypes,
        tf.app.flags.FLAGS.hypes)  # path : D:\PythonProjects\MonoGRNet\include

    logging.info("Initialize training folder")
    train.initialize_training_folder(hypes)

    #train.maybe_download_and_extract(hypes)
    logging.info("Start training")
    train.do_training(hypes)
Exemple #2
0
def main(_):
    """Run main function."""
    if FLAGS.logdir is None:
        logging.error("No logdir is given.")
        logging.error("Usage: tv-analyze --logdir dir")
        exit(1)

    utils.set_gpus_to_use()
    utils.load_plugins()

    logging.info("Starting to analyze model in '%s'", FLAGS.logdir)
    do_analyze(FLAGS.logdir)
Exemple #3
0
def main(_):
    """Run main function."""
    if FLAGS.hypes is None:
        logging.error("No hypes are given.")
        logging.error("Usage: tv-train --hypes hypes.json")
        exit(1)

    with open(tf.app.flags.FLAGS.hypes, 'r') as f:
        logging.info("f: %s", f)
        hypes = json.load(f)

    utils.set_gpus_to_use()
    #utils.load_plugins()
    utils.set_dirs(hypes, tf.app.flags.FLAGS.hypes)

    logging.info("Initialize training folder")
    initialize_training_folder(hypes)
    maybe_download_and_extract(hypes)
    logging.info("Start training")
    do_training(hypes)