File tree Expand file tree Collapse file tree 3 files changed +3
-10
lines changed Expand file tree Collapse file tree 3 files changed +3
-10
lines changed Original file line number Diff line number Diff line change 999
999
" \n " ,
1000
1000
" variables_to_restore = []\n " ,
1001
1001
" for var in slim.get_model_variables():\n " ,
1002
- " excluded = False\n " ,
1003
1002
" for exclusion in exclusions:\n " ,
1004
1003
" if var.op.name.startswith(exclusion):\n " ,
1005
- " excluded = True\n " ,
1006
1004
" break\n " ,
1007
- " if not excluded :\n " ,
1005
+ " else :\n " ,
1008
1006
" variables_to_restore.append(var)\n " ,
1009
1007
" \n " ,
1010
1008
" return slim.assign_from_checkpoint_fn(\n " ,
Original file line number Diff line number Diff line change @@ -340,12 +340,10 @@ def _get_init_fn():
340
340
# TODO(sguada) variables.filter_variables()
341
341
variables_to_restore = []
342
342
for var in slim .get_model_variables ():
343
- excluded = False
344
343
for exclusion in exclusions :
345
344
if var .op .name .startswith (exclusion ):
346
- excluded = True
347
345
break
348
- if not excluded :
346
+ else :
349
347
variables_to_restore .append (var )
350
348
351
349
if tf .gfile .IsDirectory (FLAGS .checkpoint_path ):
@@ -552,7 +550,6 @@ def clone_fn(batch_queue):
552
550
# Merge all summaries together.
553
551
summary_op = tf .summary .merge (list (summaries ), name = 'summary_op' )
554
552
555
-
556
553
###########################
557
554
# Kicks off the training. #
558
555
###########################
Original file line number Diff line number Diff line change @@ -71,12 +71,10 @@ def begin(self):
71
71
# Variable filtering by given exclude_scopes.
72
72
filtered_variables_to_restore = {}
73
73
for v in variable_to_restore :
74
- excluded = False
75
74
for exclusion in exclusions :
76
75
if v .name .startswith (exclusion ):
77
- excluded = True
78
76
break
79
- if not excluded :
77
+ else :
80
78
var_name = v .name .split (':' )[0 ]
81
79
filtered_variables_to_restore [var_name ] = v
82
80
You can’t perform that action at this time.
0 commit comments