MCPcopy
hub / github.com/yangchris11/samurai / run

Method run

sam2/training/trainer.py:499–515  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

497 return ret_tuple
498
499 def run(self):
500 assert self.mode in ["train", "train_only", "val"]
501 if self.mode == "train":
502 if self.epoch > 0:
503 logging.info(f"Resuming training from epoch: {self.epoch}")
504 # resuming from a checkpoint
505 if self.is_intermediate_val_epoch(self.epoch - 1):
506 logging.info("Running previous val epoch")
507 self.epoch -= 1
508 self.run_val()
509 self.epoch += 1
510 self.run_train()
511 self.run_val()
512 elif self.mode == "val":
513 self.run_val()
514 elif self.mode == "train_only":
515 self.run_train()
516
517 def _setup_dataloaders(self):
518 self.train_dataset = None

Callers 3

single_proc_runFunction · 0.80
run_trainerMethod · 0.80
app.pyFile · 0.80

Calls 4

run_valMethod · 0.95
run_trainMethod · 0.95
infoMethod · 0.80

Tested by

no test coverage detected