text: import torch
  
  import utility
  import data
  import model
  import loss
  from option import args
  from trainer import Trainer
  
  torch.manual_seed(args.seed)
  checkpoint = utility.checkpoint(args)
  
  
  def main():
      if args.data_test == ['video']:
          from videotester import VideoTester
          _model = model.Model(args, checkpoint)
          t = VideoTester(args, _model, checkpoint)
          t.test()
      else:
          if checkpoint.ok:
              print_args(args)
              loader = data.Data(args)
              _model = model.Model(args, checkpoint)
              _loss = loss.Loss(args, checkpoint) if not args.test_only else None
              t = Trainer(args, loader, _model, _loss, checkpoint)
  
              while not t.terminate():
                  t.train()
                  t.test()
  
              checkpoint.done()
  
  
  def print_args(args):
      for k in args.__dict__:
          print(k + ": " + str(args.__dict__[k]))
  
  
  if __name__ == '__main__':
      main()
  