本文整理汇总了Python中main.test方法的典型用法代码示例。如果您正苦于以下问题:Python main.test方法的具体用法?Python main.test怎么用?Python main.test使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类main
的用法示例。
在下文中一共展示了main.test方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import main [as 别名]
# 或者: from main import test [as 别名]
def main(_):
config = flags.FLAGS
if config.mode == "train":
train(config)
elif config.mode == "prepro":
prepro(config)
elif config.mode == "debug":
config.num_steps = 2
config.val_num_batches = 1
config.checkpoint = 1
config.period = 1
train(config)
elif config.mode == "test":
test(config)
else:
print("Unknown mode")
exit(0)
示例2: main
# 需要导入模块: import main [as 别名]
# 或者: from main import test [as 别名]
def main(_):
config = flags.FLAGS
if config.mode == "train":
train(config)
elif config.mode == "prepro":
prepro(config)
elif config.mode == "debug":
config.num_steps = 2
config.val_num_batches = 1
config.checkpoint = 1
config.period = 1
train(config)
elif config.mode == "test":
test(config)
else:
print("Unknown mode, you must choose mode from [train/prepro/debug/test]")
exit(0)
示例3: main
# 需要导入模块: import main [as 别名]
# 或者: from main import test [as 别名]
def main(_):
config = flags.FLAGS
if config.mode == "train":
train(config)
elif config.mode == "prepro":
prepro(config)
elif config.mode == "debug":
config.num_steps = 2
config.val_num_batches = 1
config.checkpoint = 1
config.period = 1
train(config)
elif config.mode == "test":
test(config)
elif config.mode == "demo":
demo(config)
else:
print("Unknown mode")
exit(0)
示例4: main
# 需要导入模块: import main [as 别名]
# 或者: from main import test [as 别名]
def main(_):
config = flags.FLAGS
os.environ["CUDA_VISIBLE_DEVICES"] = config.gpu # 选择一块gpu
if config.mode == "train":
train(config)
elif config.mode == "prepro":
data_process.prepro(config)
elif config.mode == "debug":
config.num_steps = 2
config.val_num_batches = 1
config.checkpoint = 1
config.period = 1
train(config)
elif config.mode == "test":
test(config)
elif config.mode == "examine":
examine_dev(config)
elif config.mode == "save_dev":
save_dev(config)
elif config.mode == "save_test":
save_test(config)
else:
print("Unknown mode")
exit(0)
示例5: main
# 需要导入模块: import main [as 别名]
# 或者: from main import test [as 别名]
def main(_):
config = flags.FLAGS
os.environ["CUDA_VISIBLE_DEVICES"] = config.gpu # 选择一块gpu
if config.mode == "train":
train(config)
elif config.mode == "prepro":
data_process_addAnswer.prepro(config)
elif config.mode == "test":
test(config)
elif config.mode == "examine":
examine_dev(config)
elif config.mode == "save_dev":
save_dev(config)
elif config.mode == "save_test":
save_test(config)
else:
print("Unknown mode")
exit(0)
示例6: main
# 需要导入模块: import main [as 别名]
# 或者: from main import test [as 别名]
def main(_):
config = flags.FLAGS
if config.mode == "get_vocab":
get_vocab(config)
elif config.mode == "prepare":
prepare(config)
elif config.mode == "train":
train(config)
elif config.mode == "train_rl":
train_rl(config)
elif config.mode == "train_qpp":
train_qpp(config)
elif config.mode == "train_qap":
train_qap(config)
elif config.mode == "train_qqp_qap":
train_qqp_qap(config)
elif config.mode == "test":
test(config)
else:
print("Unknown mode")
exit(0)
示例7: main
# 需要导入模块: import main [as 别名]
# 或者: from main import test [as 别名]
def main(_):
config = flags.FLAGS
if config.mode == 'prepro':
prepro(config)
elif config.mode == 'train':
train(config)
elif config.mode == 'test':
test(config)
else:
raise ValueError('The mode must choose from [prepro/train/test]!')
示例8: main
# 需要导入模块: import main [as 别名]
# 或者: from main import test [as 别名]
def main(_):
config = flags.FLAGS
if config.mode == "prepare":
prepare(config)
elif config.mode == "test":
test(config)
elif config.mode == "train":
train(config)
else:
print("Unknown mode")
exit(0)
示例9: main
# 需要导入模块: import main [as 别名]
# 或者: from main import test [as 别名]
def main(_):
config = flags.FLAGS
if config.mode == "prepare":
prepare(config)
elif config.mode == "train":
train(config)
elif config.mode == "test":
test(config)
else:
print("Unknown mode")
exit(0)