本文整理匯總了Python中config.get_args方法的典型用法代碼示例。如果您正苦於以下問題:Python config.get_args方法的具體用法?Python config.get_args怎麽用?Python config.get_args使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類config
的用法示例。
在下文中一共展示了config.get_args方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: import config [as 別名]
# 或者: from config import get_args [as 別名]
def main():
args = get_args()
nr_gpu = get_nr_gpu()
args.batch_size = args.batch_size // nr_gpu
model = Model(args)
if args.evaluate:
evaluate_wsol(args, model, interval=False)
sys.exit()
logger.set_logger_dir(ospj('train_log', args.log_dir))
config = get_config(model, args)
if args.use_pretrained_model:
config.session_init = get_model_loader(_CKPT_NAMES[args.arch_name])
launch_train_with_config(config,
SyncMultiGPUTrainerParameterServer(nr_gpu))
evaluate_wsol(args, model, interval=True)
示例2: __init__
# 需要導入模塊: import config [as 別名]
# 或者: from config import get_args [as 別名]
def __init__(self, parentThread = None, text_edit = None, text_cursor = None, ui_mode = None):
super().__init__(parentThread)
args = config.get_args()
self.is_mosaic = args.is_mosaic
self.variations = args.variations
self.mask_color = [args.mask_color_red/255.0, args.mask_color_green/255.0, args.mask_color_blue/255.0]
self.decensor_input_path = args.decensor_input_path
self.decensor_input_original_path = args.decensor_input_original_path
self.decensor_output_path = args.decensor_output_path
self.signals = None # Signals class will be given by progressWindow
self.model = None
self.warm_up = False
# if ui_mode is not None:
# self.ui_mode = ui_mode
# else:
# self.ui_mode = args.ui_mode
#
# if self.ui_mode:
# self.text_edit = text_edit
# self.text_cursor = text_cursor
# self.ui_mode = True
if not os.path.exists(self.decensor_output_path):
os.makedirs(self.decensor_output_path)