python里config_Python config.get_config方法代码示例

本文整理汇总了Python中config.get_config方法的典型用法代码示例。如果您正苦于以下问题:Python config.get_config方法的具体用法?Python config.get_config怎么用?Python config.get_config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在模块config的用法示例。

在下文中一共展示了config.get_config方法的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: main

​点赞 6

# 需要导入模块: import config [as 别名]

# 或者: from config import get_config [as 别名]

def main(_):

gpu_options = tf.GPUOptions(

per_process_gpu_memory_fraction=calc_gpu_fraction(FLAGS.gpu_fraction))

with tf.Session(config=tf.ConfigProto(gpu_options=gpu_options)) as sess:

config = get_config(FLAGS) or FLAGS

if config.env_type == 'simple':

env = SimpleGymEnvironment(config)

else:

env = GymEnvironment(config)

if not tf.test.is_gpu_available() and FLAGS.use_gpu:

raise Exception("use_gpu flag is true when no GPUs are available")

if not FLAGS.use_gpu:

config.cnn_format = 'NHWC'

agent = Agent(config, env, sess)

if FLAGS.is_train:

agent.train()

else:

agent.play()

开发者ID:devsisters,项目名称:DQN-tensorflow,代码行数:26,

示例2: init

​点赞 6

# 需要导入模块: import config [as 别名]

# 或者: from config import get_config [as 别名]

def init(browser_type):

""" Initialize the uwsgi worker which will read urls to archive from redis queue

and use associated web driver to connect to remote web browser

"""

logging.basicConfig(format='%(asctime)s: [%(levelname)s]: %(message)s',

level=logging.DEBUG)

logging.debug('WebDriver Worker Started')

config = get_config()

archives = config['archives']

rc = init_redis(config)

browser = get_avail_browser(config, rc, browser_type)

run(rc, browser, archives, config, browser_type)

开发者ID:ikreymer,项目名称:browsertrix,代码行数:19,

示例3: test

​点赞 6

# 需要导入模块: import config [as 别名]

# 或者: from config import get_config [as 别名]

def test(self):

from torch.utils.data import DataLoader

from lib.utils import Timer

from config import get_config

config = get_config()

dataset = SynthiaVoxelizationDataset(config)

timer = Timer()

data_loader = DataLoader(

dataset=dataset,

collate_fn=cfl_collate_fn_factory(limit_numpoints=False),

num_workers=0,

batch_size=4,

shuffle=True)

# Start from index 1

# for i, batch in enumerate(data_loader, 1):

iter = data_loader.__iter__()

for i in range(100):

timer.tic()

batch = iter.next()

print(batch, timer.toc())

开发者ID:chrischoy,项目名称:SpatioTemporalSegmentation,代码行数:25,

示例4: add_towel_mode

​点赞 6

# 需要导入模块: import config [as 别名]

# 或者: from config import get_config [as 别名]

def add_towel_mode(upd: Updater, handlers_group: int):

logger.info("registering towel-mode handlers")

dp = upd.dispatcher

# catch all new users and drop the towel

dp.add_handler(MessageHandler(Filters.status_update.new_chat_members, catch_new_user),

handlers_group)

# check for reply or remove messages

dp.add_handler(MessageHandler(

Filters.group & ~Filters.status_update, catch_reply),

handlers_group

)

# "i am a bot button"

dp.add_handler(CallbackQueryHandler(i_am_a_bot_btn), handlers_group)

# ban quarantine users, if time is gone

upd.job_queue.run_repeating(ban_user, interval=60, first=60, context={

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值