(config_path, config)
return config
copy config file to ckpt dirctory
copy config file to ckpt dirctory
copy config file to ckpt dirctory
def copy_config(config_path, config):
  ''' copy config file to ckpt dirctory '''
  if isinstance(config_path, Path):
    config_path = str(config_path)
  config_name = os.path.basename(config_path)
  save_config_path = os.path.join(config["solver"]["saver"]["model_path"],
                                  config_name)
  logging.info("Saving config file to {}".format(save_config_path))
  try:
    copyfile(config_path, save_config_path)
  except SameFileError:
    pass

  with open(config_path, 'r') as f:
    logging.info("Config:")
    logging.info(f.read())
  return config
def copy_config ( config_path , config ) : if isinstance ( config_path , Path ) : config_path = str ( config_path ) config_name = os . path . basename ( config_path ) save_config_path = os . path . join ( config [ "solver" ] [ "saver" ] [ "model_path" ] , config_name ) logging . info ( "Saving config file to {}" . format ( save_config_path ) ) try : copyfile ( config_path , save_config_path ) except SameFileError : pass with open ( config_path , 'r' ) as f : logging . info ( "Config:" ) logging . info ( f . read ( ) ) return config