【问题标题】:How can I solve this problem in vs code (ipynb)?如何在 vs 代码(ipynb)中解决这个问题?
【发布时间】:2021-08-03 08:56:33
【问题描述】:
import os 

image, label = load(os.path.join(PATH, 'train/cat/cat.100.jpg'), 0)
# casting to int for matplotlib to show the image
plt.figure()
plt.title(label)
plt.imshow(image/255.0)
plt.show()

当我运行它时,没有错误。但它显示为无限期进行。

【问题讨论】:

  • 你试过使用 skimage、PIL 或 opencv 吗?
  • 是的。我已经使用过 skimage,PIL。它可以工作,但这种方式也有效。所以我认为另一个问题。

标签: python python-3.x jupyter-notebook runtime-error ipython


【解决方案1】:

试试这个,

PATH = "/Users/reblochonMasque/Documents/Drawings/"
Image(filename = PATH + "My_picture.jpg", width=100, height=100)

【讨论】:

  • 感谢您的回答。编码愉快!
猜你喜欢
  • 2021-09-21
  • 1970-01-01
  • 1970-01-01
  • 2022-11-25
  • 2022-06-16
  • 2020-02-05
  • 2019-12-23
  • 2017-10-03
  • 1970-01-01
相关资源
最近更新 更多