Skip to content

Commit

Permalink
Make sure the output conv layers are with either 'linear' or 'logisti…
Browse files Browse the repository at this point in the history
…c' activation
  • Loading branch information
jkjung-avt committed May 23, 2021
1 parent 3b91b88 commit 0276e9b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions yolo/yolo_to_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,13 @@ def get_output_convs(layer_configs):
for current_layer in layer_configs.keys():
if previous_layer is not None and current_layer.endswith('yolo'):
assert previous_layer.endswith('convolutional')
layer_dict = layer_configs[previous_layer]
if layer_dict['activation'] == 'logistic':
activation = layer_configs[previous_layer]['activation']
if activation == 'linear':
output_convs.append(previous_layer)
elif activation == 'logistic':
output_convs.append(previous_layer + '_lgx')
else:
output_convs.append(previous_layer)
raise TypeError('unexpected activation: %s' % activation)
previous_layer = current_layer
return output_convs

Expand Down

0 comments on commit 0276e9b

Please sign in to comment.