-
Notifications
You must be signed in to change notification settings - Fork 443
AttributeError: np.cast was removed in NumPy 2.0 #2373
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
Comments
Hello, i did a dirty fix to resolve the issue(when I tested it I had no problems afterwards), just check my pull (sorry, i closed it when I deleted my forked repo, but you can still see the modifications) |
I can confirm @LoreBadTime fix worked for me as well. |
Can also confirm that this fix worked in my case! |
works! |
Describe the bug
When using
tf2onnx
with TensorFlow 2.18 and NumPy 2.0.2, anAttributeError
occurs due to the removal ofnp.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
To Reproduce
tf2onnx
.The text was updated successfully, but these errors were encountered: