MCPcopy Create free account
hub / github.com/CHENGY12/PLOT / main

Function main

plot-pp/train.py:143–164  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

141
142
143def main(args):
144 cfg = setup_cfg(args)
145 if cfg.SEED >= 0:
146 print("Setting fixed seed: {}".format(cfg.SEED))
147 set_random_seed(cfg.SEED)
148 setup_logger(cfg.OUTPUT_DIR)
149
150 if torch.cuda.is_available() and cfg.USE_CUDA:
151 torch.backends.cudnn.benchmark = True
152
153 print_args(args, cfg)
154 print("Collecting env info ...")
155 print("** System info **\n{}\n".format(collect_env_info()))
156
157 trainer = build_trainer(cfg)
158 if args.eval_only:
159
160 trainer.test()
161 return
162
163 if not args.no_train:
164 trainer.train()
165
166if __name__ == "__main__":
167 parser = argparse.ArgumentParser()

Callers 1

train.pyFile · 0.70

Calls 3

testMethod · 0.80
setup_cfgFunction · 0.70
print_argsFunction · 0.70

Tested by

no test coverage detected