Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------------
- TypeError Traceback (most recent call last)
- <ipython-input-6-df9959733b9a> in <module>
- 1 my_img = PIL.Image.open(img)
- ----> 2 plt.imshow(img)
- /scratch3/venv/djrn/lib/python3.8/site-packages/matplotlib/pyplot.py in imshow(X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, filternorm, filterrad, resample, url, data, **kwargs)
- 2722 filternorm=True, filterrad=4.0, resample=None, url=None,
- 2723 data=None, **kwargs):
- -> 2724 __ret = gca().imshow(
- 2725 X, cmap=cmap, norm=norm, aspect=aspect,
- 2726 interpolation=interpolation, alpha=alpha, vmin=vmin,
- /scratch3/venv/djrn/lib/python3.8/site-packages/matplotlib/__init__.py in inner(ax, data, *args, **kwargs)
- 1436 def inner(ax, *args, data=None, **kwargs):
- 1437 if data is None:
- -> 1438 return func(ax, *map(sanitize_sequence, args), **kwargs)
- 1439
- 1440 bound = new_sig.bind(ax, *args, **kwargs)
- /scratch3/venv/djrn/lib/python3.8/site-packages/matplotlib/axes/_axes.py in imshow(self, X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, filternorm, filterrad, resample, url, **kwargs)
- 5521 resample=resample, **kwargs)
- 5522
- -> 5523 im.set_data(X)
- 5524 im.set_alpha(alpha)
- 5525 if im.get_clip_path() is None:
- /scratch3/venv/djrn/lib/python3.8/site-packages/matplotlib/image.py in set_data(self, A)
- 698 if (self._A.dtype != np.uint8 and
- 699 not np.can_cast(self._A.dtype, float, "same_kind")):
- --> 700 raise TypeError("Image data of dtype {} cannot be converted to "
- 701 "float".format(self._A.dtype))
- 702
- TypeError: Image data of dtype <U15 cannot be converted to float
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement