parameters: (self, solver_prototxt, roidb, output_dir,
                   pretrained_model=None)
docstring: Initialize the SolverWrapper.
docstring_summary: Initialize the SolverWrapper.
docstring_tokens: Initialize the SolverWrapper .
function: def __init__(self, solver_prototxt, roidb, output_dir,
                   pretrained_model=None):
          """Initialize the SolverWrapper."""
          self.output_dir = output_dir
  
          if (cfg.TRAIN.HAS_RPN and cfg.TRAIN.BBOX_REG and
              cfg.TRAIN.BBOX_NORMALIZE_TARGETS):
              # RPN can only use precomputed normalization because there are no
              # fixed statistics to compute a priori
              assert cfg.TRAIN.BBOX_NORMALIZE_TARGETS_PRECOMPUTED
  
          if cfg.TRAIN.BBOX_REG:
              print 'Computing bounding-box regression targets...'
              self.bbox_means, self.bbox_stds = \
                      rdl_roidb.add_bbox_regression_targets(roidb)
              print 'done'
  
          self.solver = caffe.SGDSolver(solver_prototxt)
          if pretrained_model is not None:
              print ('Loading pretrained model '
                     'weights from {:s}').format(pretrained_model)
              self.solver.net.copy_from(pretrained_model)
  
          self.solver_param = caffe_pb2.SolverParameter()
          with open(solver_prototxt, 'rt') as f:
              pb2.text_format.Merge(f.read(), self.solver_param)
  
          self.solver.net.layers[0].set_roidb(roidb)
function_tokens: def __init__ ( self , solver_prototxt , roidb , output_dir , pretrained_model = None ) : self . output_dir = output_dir if ( cfg . TRAIN . HAS_RPN and cfg . TRAIN . BBOX_REG and cfg . TRAIN . BBOX_NORMALIZE_TARGETS ) : # RPN can only use precomputed normalization because there are no # fixed statistics to compute a priori assert cfg . TRAIN . BBOX_NORMALIZE_TARGETS_PRECOMPUTED if cfg . TRAIN . BBOX_REG : print 'Computing bounding-box regression targets...' self . bbox_means , self . bbox_stds = rdl_roidb . add_bbox_regression_targets ( roidb ) print 'done' self . solver = caffe . SGDSolver ( solver_prototxt ) if pretrained_model is not None : print ( 'Loading pretrained model ' 'weights from {:s}' ) . format ( pretrained_model ) self . solver . net . copy_from ( pretrained_model ) self . solver_param = caffe_pb2 . SolverParameter ( ) with open ( solver_prototxt , 'rt' ) as f : pb2 . text_format . Merge ( f . read ( ) , self . solver_param ) self . solver . net . layers [ 0 ] . set_roidb ( roidb )