Skip to content

Commit

Permalink
Fix bug in relu6 activation #38
Browse files Browse the repository at this point in the history
  • Loading branch information
MarsTechHAN committed Jan 28, 2022
1 parent 96d7f1b commit d0257c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion keras2ncnn/keras_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,8 @@ def Activation_helper(
else:
negative_slope = 0.0

if '_relu6' in layer['layer']['config']['activation']:
if '_relu6' in layer['layer']['config']['activation'] or \
'relu6' in layer['layer']['config']['activation']:
layer['layer']['config']['max_value'] = 6.0
layer['layer']['config']['activation'] = 'relu'

Expand Down

0 comments on commit d0257c8

Please sign in to comment.