When I wrote codes according to p1ch7/2_bird_airplanes.ipynb, at the In[12] part, there was something wrong:
the original codes are:
img, _ = cifar2[3]
plt.imshow(img.permute(1, 2, 0)
plt.show()
and the compiler told me:
AttributeError Traceback (most recent call last)
in
1 img, _ = cifar2[3]
----> 2 plt.imshow(img.permute(1, 2, 0))
3 plt.show()
AttributeError: 'Image' object has no attribute 'permute'
*****************************************************************************************************
it turns out that the "img" here is an Image object rather than a tensor, so I rewrite it as following:
img, _ = cifar2[3]
plt.imshow(img)
plt.show()
and this really works! Hope to help someone else~
When I wrote codes according to p1ch7/2_bird_airplanes.ipynb, at the In[12] part, there was something wrong:
the original codes are: img, _ = cifar2[3] plt.imshow(img.permute(1, 2, 0) plt.show()
and the compiler told me:
AttributeError Traceback (most recent call last)