为什么带有matplotlib的标注出现错误

2024-06-28 15:22:27 发布

您现在位置:Python中文网/ 问答频道 /正文

enter image description here

<iframe src="https://jovian.ml/embed?url=https://jovian.ml/pravin-bnmit/cxr/v/1&cellId=15" title="Jovian Viewer" height="800" width="800" frameborder="0" scrolling="auto"></iframe>
def show_sample(img, target, invert=True):
if invert:
    plt.imshow(1 - img.permute((1, 2, 0)))
else:
    plt.imshow(img.permute(1, 2, 0))
print('Labels:', decode_target(target, text_labels=True))

尝试显示图像,但在通道定义正确时出现尺寸错误


Tags: httpssrctrueurltargetimgpltembed