Skip to content

Conversation

@vvolhejn
Copy link
Contributor

@vvolhejn vvolhejn commented Jul 4, 2022

I was getting deprecation warnings from NumPy when running tf2onnx:

/home/vaclav/venv3.8/lib/python3.8/site-packages/tf2onnx/tf_utils.py:53: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations if np_data.dtype == np.object: /home/vaclav/venv3.8/lib/python3.8/site-packages/onnx/numpy_helper.py:93: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations if arr.dtype == np.object: /home/vaclav/venv3.8/lib/python3.8/site-packages/tf2onnx/graph.py:585: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations is_bytes = np_val.dtype == np.object and len(np_val_flat) > 0 and isinstance(np_val_flat[0], bytes) 

As per the linked guide, object should be used instead of np.object.

I just searched-and-replaced np.object with object across the codebase to fix this.

Signed-off-by: Václav Volhejn <vaclav.volhejn@gmail.com>
Copy link
Contributor

@hwangdeyu hwangdeyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your contribution!

@hwangdeyu hwangdeyu merged commit fa0b6cf into onnx:main Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants