full trace:
TypeError Traceback (most recent call last)
in
3 x.show(ax, y=y)
4
----> 5 plot_multi(_plot, 3, 3, figsize=(8,8))
~/anaconda3/lib/python3.7/site-packages/fastai/vision/image.py in plot_multi(func, r, c, figsize)
614 axes = plt.subplots(r, c, figsize=figsize)[1]
615 for i in range(r):
→ 616 for j in range(c): func(i,j,axes[i,j])
617
618 def show_multi(func:Callable[[int,int],Image], r:int=1, c:int=1, figsize:Tuple=(9,9)):
in _plot(i, j, ax)
1 def _plot(i,j,ax):
2 x,y = data.train_ds[3]
----> 3 x.show(ax, y=y)
4
5 plot_multi(_plot, 3, 3, figsize=(8,8))
~/anaconda3/lib/python3.7/site-packages/fastai/vision/image.py in show(self, ax, figsize, title, hide_axis, cmap, y, **kwargs)
218 “Show image on ax
with title
, using cmap
if single-channel, overlaid with optional y
”
219 cmap = ifnone(cmap, defaults.cmap)
→ 220 ax = show_image(self, ax=ax, hide_axis=hide_axis, cmap=cmap, figsize=figsize)
221 if y is not None: y.show(ax=ax, **kwargs)
222 if title is not None: ax.set_title(title)
~/anaconda3/lib/python3.7/site-packages/fastai/vision/image.py in show_image(img, ax, figsize, hide_axis, cmap, alpha, **kwargs)
434 if ax is None: fig,ax = plt.subplots(figsize=figsize)
435 xtr = dict(cmap=cmap, alpha=alpha, **kwargs)
→ 436 ax.imshow(image2np(img.data), **xtr) if (hasattr(img, ‘cpu’)) else ax.imshow(img, **xtr)
437 if hide_axis: ax.axis(‘off’)
438 return ax
~/anaconda3/lib/python3.7/site-packages/matplotlib/init.py in inner(ax, data, *args, **kwargs)
1587 def inner(ax, *args, data=None, **kwargs):
1588 if data is None:
→ 1589 return func(ax, *map(sanitize_sequence, args), **kwargs)
1590
1591 bound = new_sig.bind(ax, *args, **kwargs)
~/anaconda3/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py in wrapper(*args, **kwargs)
367 f"%(removal)s. If any parameter follows {name!r}, they "
368 f"should be pass as keyword, not positionally.")
→ 369 return func(*args, **kwargs)
370
371 return wrapper
~/anaconda3/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py in wrapper(*args, **kwargs)
367 f"%(removal)s. If any parameter follows {name!r}, they "
368 f"should be pass as keyword, not positionally.")
→ 369 return func(*args, **kwargs)
370
371 return wrapper
~/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_axes.py in imshow(self, X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, url, **kwargs)
5658 resample=resample, **kwargs)
5659
→ 5660 im.set_data(X)
5661 im.set_alpha(alpha)
5662 if im.get_clip_path() is None:
~/anaconda3/lib/python3.7/site-packages/matplotlib/image.py in set_data(self, A)
676 not np.can_cast(self._A.dtype, float, “same_kind”)):
677 raise TypeError("Image data of dtype {} cannot be converted to "
→ 678 “float”.format(self._A.dtype))
679
680 if not (self._A.ndim == 2
TypeError: Image data of dtype object cannot be converted to float