本文整理汇总了Python中caffe.init_log方法的典型用法代码示例。如果您正苦于以下问题:Python caffe.init_log方法的具体用法?Python caffe.init_log怎么用?Python caffe.init_log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类caffe
的用法示例。
在下文中一共展示了caffe.init_log方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: train
# 需要导入模块: import caffe [as 别名]
# 或者: from caffe import init_log [as 别名]
def train(
solver, # solver proto definition
snapshot, # solver snapshot to restore
gpus, # list of device ids
timing=False, # show timing info for compute and communications
):
# NCCL uses a uid to identify a session
uid = caffe.NCCL.new_uid()
caffe.init_log()
caffe.log('Using devices %s' % str(gpus))
procs = []
for rank in range(len(gpus)):
p = Process(target=solve_step,
args=(solver, snapshot, gpus, timing, uid, rank))
p.daemon = True
p.start()
procs.append(p)
for p in procs:
p.join()
示例2: train_net_multi_gpu
# 需要导入模块: import caffe [as 别名]
# 或者: from caffe import init_log [as 别名]
def train_net_multi_gpu(solver_prototxt, roidb, output_dir, pretrained_model,
max_iter, gpus, reload):
"""Train a Fast R-CNN network."""
roidb = filter_roidb(roidb)
uid = caffe.NCCL.new_uid()
caffe.init_log()
caffe.log('Using devices %s' % str(gpus))
procs = []
for rank in range(len(gpus)):
p = Process(target=solve,
args=(
solver_prototxt, roidb, pretrained_model, gpus, uid,
rank,
output_dir, max_iter, reload))
p.daemon = True
p.start()
procs.append(p)
for p in procs:
p.join()
示例3: train
# 需要导入模块: import caffe [as 别名]
# 或者: from caffe import init_log [as 别名]
def train(
solver, # solver proto definition
snapshot, # solver snapshot to restore
gpus, # list of device ids
timing=False, # show timing info for compute and communications
):
# NCCL uses a uid to identify a session
uid = caffe.NCCL.new_uid()
caffe.init_log()
caffe.log('Using devices %s' % str(gpus))
procs = []
for rank in range(len(gpus)):
p = Process(target=solve,
args=(solver, snapshot, gpus, timing, uid, rank))
p.daemon = True
p.start()
procs.append(p)
for p in procs:
p.join()
示例4: train
# 需要导入模块: import caffe [as 别名]
# 或者: from caffe import init_log [as 别名]
def train(
solver, # solver proto definition
snapshot, # solver snapshot to restore
use_cpu, #whether use cpu
gpus, # list of device ids
timing=False, # show timing info for compute and communications
):
caffe.init_log(0,True)
caffe.log('Using devices %s' % str(gpus))
if use_cpu == True:
p = Process(target=cpu_solve,
args=(solver, snapshot, timing))
p.daemon = True
p.start()
p.join()
else:
# NCCL uses a uid to identify a session
uid = caffe.NCCL.new_uid()
procs = []
for rank in range(len(gpus)):
p = Process(target=solve,
args=(solver, snapshot, gpus, timing, uid, rank))
p.daemon = True
p.start()
procs.append(p)
for p in procs:
p.join()