Skip to content

Commit

Permalink
Cast regularization parameters to float. (tensorflow#1707)
Browse files Browse the repository at this point in the history
This works around a bug in earlier proto versions
that automatically infer these values to be integer
instead of float.
  • Loading branch information
jch1 authored and sguada committed Jun 20, 2017
1 parent 434c277 commit c4ba26b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions object_detection/builders/hyperparams_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ def _build_regularizer(regularizer):
"""
regularizer_oneof = regularizer.WhichOneof('regularizer_oneof')
if regularizer_oneof == 'l1_regularizer':
return slim.l1_regularizer(scale=regularizer.l1_regularizer.weight)
return slim.l1_regularizer(scale=float(regularizer.l1_regularizer.weight))
if regularizer_oneof == 'l2_regularizer':
return slim.l2_regularizer(scale=regularizer.l2_regularizer.weight)
return slim.l2_regularizer(scale=float(regularizer.l2_regularizer.weight))
raise ValueError('Unknown regularizer function: {}'.format(regularizer_oneof))


Expand Down

0 comments on commit c4ba26b

Please sign in to comment.