예제 #1
0
 def var_shape_matched(var, shape):
     """
     Check whehter persitable variable shape is match with current network
     """
     var_exist = os.path.exists(
         os.path.join(cfg.TRAIN.PRETRAINED_MODEL_DIR, var.name))
     if var_exist:
         var_shape = parse_shape_from_file(
             os.path.join(cfg.TRAIN.PRETRAINED_MODEL_DIR, var.name))
         return var_shape == shape
     return False
예제 #2
0
파일: train.py 프로젝트: nepeplwu/PaddleSeg
 def var_shape_matched(var, shape):
     """
     Check whehter persitable variable shape is match with current network
     """
     var_exist = os.path.exists(
         os.path.join(cfg.TRAIN.PRETRAINED_MODEL, var.name))
     if var_exist:
         var_shape = parse_shape_from_file(
             os.path.join(cfg.TRAIN.PRETRAINED_MODEL, var.name))
         if var_shape == shape:
             return True
         else:
             print(
                 "Variable[{}] shape does not match current network, skip"
                 " to load it.".format(var.name))
             return False