How to use the memcnn.config.Config.get_filename function in memcnn

To help you get started, we’ve selected a few memcnn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github silvandeleemput / memcnn / memcnn / train.py View on Github external
if not args.use_cuda:
        logger.warning('CUDA is disabled!!!')

    # run experiment given arguments
    run_experiment(
        args.experiment_tags,
        args.data_dir,
        args.results_dir,
        start_fresh=args.start_fresh,
        experiments_file=args.experiments_file,
        use_cuda=args.use_cuda, workers=args.workers)


if __name__ == '__main__':  # pragma: no cover
    config_fname = Config.get_filename()
    if not os.path.exists(config_fname) or not 'data_dir' in Config() or not 'results_dir' in Config():
        print('The configuration file was not set correctly.\n')
        print('Please create a configuration file (json) at:\n {}\n'.format(config_fname))
        print('The configuration file should be formatted as follows:\n\n'
              '{\n'
              '    "data_dir": "/home/user/data",\n'
              '    "results_dir": "/home/user/experiments"\n'
              '}\n')
        print('data_dir    : location for storing the input training datasets')
        print('results_dir : location for storing the experiment files during training')
    else:
        main(data_dir=Config()['data_dir'],
             results_dir=Config()['results_dir'])