diff --git a/tensorboard/compat/tensorflow_stub/dtypes.py b/tensorboard/compat/tensorflow_stub/dtypes.py index 5a2e10cb10..af96254a6e 100644 --- a/tensorboard/compat/tensorflow_stub/dtypes.py +++ b/tensorboard/compat/tensorflow_stub/dtypes.py @@ -674,7 +674,7 @@ def as_dtype(type_value): # dtype with a single constant (np.string does not exist) to decide # dtype is a "string" type. We need to compare the dtype.type to be # sure it's a string type. - if type_value.type == np.string_ or type_value.type == np.unicode_: + if type_value.type == np.bytes_ or type_value.type == np.str_: return string if isinstance(type_value, (type, np.dtype)): diff --git a/tensorboard/util/tensor_util.py b/tensorboard/util/tensor_util.py index 032e19bdec..cbf4758925 100644 --- a/tensorboard/util/tensor_util.py +++ b/tensorboard/util/tensor_util.py @@ -137,7 +137,7 @@ def GetNumpyAppendFn(dtype): # dtype with a single constant (np.string does not exist) to decide # dtype is a "string" type. We need to compare the dtype.type to be # sure it's a string type. - if dtype.type == np.string_ or dtype.type == np.unicode_: + if dtype.type == np.bytes_ or dtype.type == np.str_: return SlowAppendObjectArrayToTensorProto return GetFromNumpyDTypeDict(_NP_TO_APPEND_FN, dtype)