Fixed train.py SyntaxError due to last commit (#1336)

Fixed unexpected character after line continuation character on line 148,150, and 151
This commit is contained in:
NanoCode012 2020-06-25 01:37:09 +07:00 committed by GitHub
parent 8a414743e2
commit a587d39cd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -145,10 +145,9 @@ def train(hyp):
load_darknet_weights(model, weights) load_darknet_weights(model, weights)
if opt.freeze_layers: if opt.freeze_layers:
output_layer_indices = [idx - 1 for idx, module in enumerate(model.module_list) \ output_layer_indices = [idx - 1 for idx, module in enumerate(model.module_list) if isinstance(module, YOLOLayer)]
if isinstance(module, YOLOLayer)] freeze_layer_indices = [x for x in range(len(model.module_list)) if
freeze_layer_indices = [x for x in range(len(model.module_list)) if\ (x not in output_layer_indices) and
(x not in output_layer_indices) and \
(x - 1 not in output_layer_indices)] (x - 1 not in output_layer_indices)]
for idx in freeze_layer_indices: for idx in freeze_layer_indices:
for parameter in model.module_list[idx].parameters(): for parameter in model.module_list[idx].parameters():