Skip to content

Commit

Permalink
Delete "RuntimeWarning" it is not having the intended effect.
Browse files Browse the repository at this point in the history
These `RuntimeWarning` are being interpreted as arguments to the string formatting, raising "TypeError: not all arguments converted during string formatting" errors.

PiperOrigin-RevId: 199307228
  • Loading branch information
MarkDaoust authored and tensorflower-gardener committed Jun 5, 2018
1 parent 51445a7 commit 72f6b4d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tensorflow/python/keras/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ def __init__(self,

if mode not in ['auto', 'min', 'max']:
logging.warning('ModelCheckpoint mode %s is unknown, '
'fallback to auto mode.', (mode), RuntimeWarning)
'fallback to auto mode.', mode)
mode = 'auto'

if mode == 'min':
Expand All @@ -451,7 +451,7 @@ def on_epoch_end(self, epoch, logs=None):
current = logs.get(self.monitor)
if current is None:
logging.warning('Can save best model only with %s available, '
'skipping.', self.monitor, RuntimeWarning)
'skipping.', self.monitor)
else:
if self.monitor_op(current, self.best):
if self.verbose > 0:
Expand Down Expand Up @@ -515,7 +515,7 @@ def __init__(self,

if mode not in ['auto', 'min', 'max']:
logging.warning('EarlyStopping mode %s is unknown, '
'fallback to auto mode.', mode, RuntimeWarning)
'fallback to auto mode.', mode)
mode = 'auto'

if mode == 'min':
Expand Down Expand Up @@ -544,7 +544,7 @@ def on_epoch_end(self, epoch, logs=None):
if current is None:
logging.warning('Early stopping conditioned on metric `%s` '
'which is not available. Available metrics are: %s',
self.monitor, ','.join(list(logs.keys())), RuntimeWarning)
self.monitor, ','.join(list(logs.keys())))
return
if self.monitor_op(current - self.min_delta, self.best):
self.best = current
Expand Down Expand Up @@ -898,7 +898,7 @@ def _reset(self):
"""
if self.mode not in ['auto', 'min', 'max']:
logging.warning('Learning Rate Plateau Reducing mode %s is unknown, '
'fallback to auto mode.', self.mode, RuntimeWarning)
'fallback to auto mode.', self.mode)
self.mode = 'auto'
if (self.mode == 'min' or
(self.mode == 'auto' and 'acc' not in self.monitor)):
Expand All @@ -920,7 +920,7 @@ def on_epoch_end(self, epoch, logs=None):
if current is None:
logging.warning('Reduce LR on plateau conditioned on metric `%s` '
'which is not available. Available metrics are: %s',
self.monitor, ','.join(list(logs.keys())), RuntimeWarning)
self.monitor, ','.join(list(logs.keys())))

else:
if self.in_cooldown():
Expand Down

0 comments on commit 72f6b4d

Please sign in to comment.