本文整理匯總了Python中fast_rcnn.config.cfg.MODELS_DIR屬性的典型用法代碼示例。如果您正苦於以下問題:Python cfg.MODELS_DIR屬性的具體用法?Python cfg.MODELS_DIR怎麽用?Python cfg.MODELS_DIR使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類fast_rcnn.config.cfg
的用法示例。
在下文中一共展示了cfg.MODELS_DIR屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_solvers
# 需要導入模塊: from fast_rcnn.config import cfg [as 別名]
# 或者: from fast_rcnn.config.cfg import MODELS_DIR [as 別名]
def get_solvers(net_name):
# Faster R-CNN Alternating Optimization
n = 'faster_rcnn_alt_opt'
# Solver for each training stage
solvers = [[net_name, n, 'stage1_rpn_solver60k80k.pt'],
[net_name, n, 'stage1_fast_rcnn_solver30k40k.pt'],
[net_name, n, 'stage2_rpn_solver60k80k.pt'],
[net_name, n, 'stage2_fast_rcnn_solver30k40k.pt']]
solvers = [os.path.join(cfg.MODELS_DIR, *s) for s in solvers]
# Iterations for each training stage
max_iters = [80000, 40000, 80000, 40000]
# max_iters = [100, 100, 100, 100]
# Test prototxt for the RPN
rpn_test_prototxt = os.path.join(
cfg.MODELS_DIR, net_name, n, 'rpn_test.pt')
return solvers, max_iters, rpn_test_prototxt
# ------------------------------------------------------------------------------
# Pycaffe doesn't reliably free GPU memory when instantiated nets are discarded
# (e.g. "del net" in Python code). To work around this issue, each training
# stage is executed in a separate process using multiprocessing.Process.
# ------------------------------------------------------------------------------
示例2: get_solvers
# 需要導入模塊: from fast_rcnn.config import cfg [as 別名]
# 或者: from fast_rcnn.config.cfg import MODELS_DIR [as 別名]
def get_solvers(imdb_name, net_name, model_name):
# R-FCN Alternating Optimization
# Solver for each training stage
if imdb_name.startswith('coco'):
solvers = [[net_name, model_name, 'stage1_rpn_solver360k480k.pt'],
[net_name, model_name, 'stage1_rfcn_ohem_solver360k480k.pt'],
[net_name, model_name, 'stage2_rpn_solver360k480k.pt'],
[net_name, model_name, 'stage2_rfcn_ohem_solver360k480k.pt'],
[net_name, model_name, 'stage3_rpn_solver360k480k.pt']]
solvers = [os.path.join('.', 'models', 'coco', *s) for s in solvers]
# Iterations for each training stage
max_iters = [480000, 480000, 480000, 480000, 480000]
# Test prototxt for the RPN
rpn_test_prototxt = os.path.join(
'.', 'models', 'coco', net_name, model_name, 'rpn_test.pt')
else:
solvers = [[net_name, model_name, 'stage1_rpn_solver60k80k.pt'],
[net_name, model_name, 'stage1_rfcn_ohem_solver80k120k.pt'],
[net_name, model_name, 'stage2_rpn_solver60k80k.pt'],
[net_name, model_name, 'stage2_rfcn_ohem_solver80k120k.pt'],
[net_name, model_name, 'stage3_rpn_solver60k80k.pt']]
solvers = [os.path.join(cfg.MODELS_DIR, *s) for s in solvers]
# Iterations for each training stage
max_iters = [80000, 120000, 80000, 120000, 80000]
# Test prototxt for the RPN
rpn_test_prototxt = os.path.join(
cfg.MODELS_DIR, net_name, model_name, 'rpn_test.pt')
return solvers, max_iters, rpn_test_prototxt