code: def main(args):
      prepare_envs(args)
  
      if args.teather_config is None or args.student_config is None:
          raise RuntimeError("No configuration file specified.")
      t_cfg = Config(args.teather_config)
      s_cfg = Config(
          args.student_config,
          learning_rate=args.learning_rate,
          iters=args.iters,
          batch_size=args.batch_size,
      )
      t_builder = SegBuilder(t_cfg)
      s_builder = SegBuilder(s_cfg)
  
      msg = (
          "\n---------------Teacher Config Information---------------\n"
      )
      msg += str(t_cfg)
      msg += "------------------------------------------------"
      logger.info(msg)
  
      msg = (
          "\n---------------Student Config Information---------------\n"
      )
      msg += str(s_cfg)
      msg += "------------------------------------------------"
      logger.info(msg)
  
      distill_config = prepare_distill_config()
  
      s_adaptor, t_adaptor = prepare_distill_adaptor()
  
      t_model = t_builder.model
      s_model = s_builder.model
      t_model.eval()
      s_model.train()
  
      distill_model = Distill(
          distill_config, s_model, t_model, s_adaptor, t_adaptor
      )
  
      distill_train(
          distill_model=distill_model,
          train_dataset=s_builder.train_dataset,
          val_dataset=s_builder.val_dataset,
          optimizer=s_builder.optimizer,
          save_dir=args.save_dir,
          iters=s_builder.iters,
          batch_size=s_builder.batch_size,
          resume_model=args.resume_model,
          save_interval=args.save_interval,
          log_iters=args.log_iters,
          num_workers=args.num_workers,
          use_vdl=args.use_vdl,
          losses=s_builder.loss,
          distill_losses=s_builder.distill_loss,
          keep_checkpoint_max=args.keep_checkpoint_max,
          test_config=s_cfg.test_config,
      )
  
file_path: PaddleSeg/deploy/slim/distill/distill_train.py
imports: import argparse
  from paddleslim.dygraph.dist import Distill
  from paddleseg.cvlibs import Config, SegBuilder
  from paddleseg.utils import logger, utils
  from distill_utils import distill_train
  from distill_config import prepare_distill_adaptor, prepare_distill_config
label_desc: Use image node_id 3 for calling a global function with example usage: main(args) without return types