Closed suchanek closed 8 months ago
Sorry, I had pasted the wrong statement. The original code that failed was:
# Save them to disc
im = Image.fromarray(x.__array__())
Sorry, I had pasted the wrong statement. The original code that failed was:
# Save them to disc im = Image.fromarray(x.__array__())
I had the same problem. Workaround using numpy but presumably it shouldn't happen if it worked in an earlier release.
import numpy as np
# this is to avoid the problem with __array__
x_numpy = np.asarray(x) # Convert mlx array to numpy array
im = Image.fromarray(x_numpy)
Fix in #266, sorry for breaking that.
Awesome, Thanks!
Running the program fails with:
File "/Users/egs/repos/mlx-examples/stable_diffusion/txt2image.py", line 55, in
im = Image.fromarray(x.array())
AttributeError: 'mlx.core.array' object has no attribute 'array'
Note that this worked in the prior release of mlx, but fails under version: mlx 0.0.7.dev202418+0b8aedd pypi_0 pypi