Open weymouth opened 6 years ago
I just replicated the old scipy.misc.imread
functionality with Pillow instead:
from PIL import Image
def imread(fname):
return np.array(Image.open(fname))
This works well. I could send you a pull request if you want to keep the example up-to-date.
Totally would love to see the example updated! cc: @matjj @duvenaud
The scipy library for image reading is deprecated, with the functionality now in the
imageio
library. However, when I use this library the backward differentiation fails.The only change made is to use
imageio
instead ofscipy.misc
in the linefrom imageio import imread
which results in the error:
TypeError: Can't differentiate w.r.t. type <class 'imageio.core.util.Image'>
I suppose I could work around this by converting the image into a numpy array, but I wondered if you had a more native approach to working with images now.