Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] np.str, np.bool are deprecated in higher version of numpy #488

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions easy_rec/python/core/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def _get_np_type(field_type):
type_map = {
DatasetConfig.INT32: np.int32,
DatasetConfig.INT64: np.int64,
DatasetConfig.STRING: np.str,
DatasetConfig.BOOL: np.bool,
DatasetConfig.STRING: str,
DatasetConfig.BOOL: bool,
DatasetConfig.FLOAT: np.float32,
DatasetConfig.DOUBLE: np.double
}
Expand Down Expand Up @@ -329,7 +329,7 @@ def __init__(self,
for col_id in range(len(self._attr_np_types)):
np_type = self._attr_np_types[col_id]
print('\tcol_id[%d], dtype=%s' % (col_id, self._attr_gl_types[col_id]))
if np_type != np.str:
if np_type != str:
self._cols[col_id] = np.array(self._cols[col_id], dtype=np_type)
else:
self._cols[col_id] = np.asarray(
Expand Down Expand Up @@ -417,7 +417,7 @@ def _get_impl(self, ids):
for col_id in range(len(self._cols)):
tmp_col = self._cols[col_id]
np_type = self._attr_np_types[col_id]
if np_type != np.str:
if np_type != str:
sel_feas = tmp_col[sel_ids]
features.append(sel_feas)
else:
Expand Down
2 changes: 1 addition & 1 deletion easy_rec/python/utils/config_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def _get_basic_types():
bool, int, str, float,
type(u''), np.float16, np.float32, np.float64, np.char, np.byte, np.uint8,
np.int8, np.int16, np.uint16, np.uint32, np.int32, np.uint64, np.int64,
np.bool, np.str
bool, str
]
if six.PY2:
dtypes.append(long) # noqa: F821
Expand Down
1 change: 0 additions & 1 deletion easy_rec/python/utils/input_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def np_to_tf_type(np_type):
int: tf.int32,
np.int32: tf.int32,
np.int64: tf.int64,
np.str: tf.string,
str: tf.string,
np.float: tf.float32,
np.float32: tf.float32,
Expand Down
Loading