Open
Description
Describe the bug
When using tf2onnx
with TensorFlow 2.18 and NumPy 2.0.2, an AttributeError
occurs due to the removal of np.cast
in NumPy 2.0. The error message is as follows:
File "site-packages/tf2onnx/tfonnx.py", line 77, in rewrite_constant_fold "Cast": np.cast, AttributeError: np.cast was removed in the NumPy 2.0 release. Use np.asarray(arr, dtype=dtype) instead.
System information
- OS Platform and Distribution: Ubuntu 22.04.5 LTS
- TensorFlow Version: 2.18
- tf2onnx Version: 2.16.1
- Python version: 3.10.12
To Reproduce
- Install TensorFlow 2.18 and tf2onnx 1.16.1.
- Ensure NumPy above 2.0 is installed.
- Run a script that uses
tf2onnx
.