MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / main

Function main

tools/train_net.py:131–157  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

129
130
131def main(args):
132 cfg = setup(args)
133
134 if args.eval_only:
135 model = Trainer.build_model(cfg)
136 DetectionCheckpointer(model, save_dir=cfg.OUTPUT_DIR).resume_or_load(
137 cfg.MODEL.WEIGHTS, resume=args.resume
138 )
139 res = Trainer.test(cfg, model)
140 if cfg.TEST.AUG.ENABLED:
141 res.update(Trainer.test_with_TTA(cfg, model))
142 if comm.is_main_process():
143 verify_results(cfg, res)
144 return res
145
146 """
147 If you'd like to do anything fancier than the standard training logic,
148 consider writing your own training loop (see plain_train_net.py) or
149 subclassing the trainer.
150 """
151 trainer = Trainer(cfg)
152 trainer.resume_or_load(resume=args.resume)
153 if cfg.TEST.AUG.ENABLED:
154 trainer.register_hooks(
155 [hooks.EvalHook(0, lambda: trainer.test_with_TTA(cfg, trainer.model))]
156 )
157 return trainer.train()
158
159
160if __name__ == "__main__":

Callers

nothing calls this directly

Calls 11

test_with_TTAMethod · 0.95
verify_resultsFunction · 0.90
build_modelMethod · 0.80
resume_or_loadMethod · 0.80
register_hooksMethod · 0.80
setupFunction · 0.70
TrainerClass · 0.70
testMethod · 0.45
updateMethod · 0.45
trainMethod · 0.45

Tested by

no test coverage detected