PY3 Migration- make keras/callbacks.py py3 compatible.

PiperOrigin-RevId: 280509492
Change-Id: I4ba0f66b13533f3169fd61bfcf84d7d735378ff5
This commit is contained in:
Hye Soo Yang 2019-11-14 14:10:41 -08:00 committed by TensorFlower Gardener
parent 0ecdc65d86
commit dd6f51d33b
2 changed files with 4 additions and 2 deletions

View File

@ -1423,8 +1423,10 @@ tf_py_test(
":keras",
"@absl_py//absl/testing:parameterized",
"//third_party/py/numpy",
"@six_archive//:six",
"//tensorflow/python:client_testlib",
],
python_version = "PY3",
shard_count = 4,
tags = [
"no_oss",

View File

@ -1041,8 +1041,8 @@ class ModelCheckpoint(Callback):
self._maybe_remove_file()
except IOError as e:
# `e.errno` appears to be `None` so checking the content of `e.message`.
if 'is a directory' in e.message:
# `e.errno` appears to be `None` so checking the content of `e.args[0]`.
if 'is a directory' in six.ensure_str(e.args[0]):
raise IOError('Please specify a non-directory filepath for '
'ModelCheckpoint. Filepath used is an existing '
'directory: {}'.format(filepath))