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

TypeError: __array__() takes 1 positional argument but 2 were given #5582

Closed
alexisbenichoux opened this issue Jul 5, 2021 · 2 comments
Closed

Comments

@alexisbenichoux
Copy link

If anyone needs this compared to pillow 8.2, pillow 8.3 converting Image to numpy array does not accept dtype any more.

np.array(img, dtype=np.float32)

must be replaced by np.array(img.__array__(), dtype=np.float32)

@dstein64
Copy link

dstein64 commented Jul 5, 2021

Issue #5571 covers the same error. PR #5572 has a fix.

@radarhere
Copy link
Member

Pillow 8.3.1 has now been released with the fix.

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

No branches or pull requests

3 participants