Skip to content

Conversation

bhawkins
Copy link

When I try to write out a large file in RAT format, I get warnings about overflow and size mismatches. This occurs because the items in the shape member have type numpy.int32, and multiplying shape[0] * shape[1] causes an overflow for images larger than 2 gigapixels. The prod function in Numpy promotes to the native integer type, which is usually 64-bits these days. If we wanted to guarantee that behavior we could further specify dtype='int64'.

I'm guessing this issue is specific to numpy versions >= 2.0 when various type promotion rules were changed (NEP 50). I'm using numpy v2.2.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant