【发布时间】:2020-10-14 05:55:03
【问题描述】:
我的代码,
def loadImages(path):
imageList = listdir(path)
loadedImages = []
for image in imagesList:
img = PImage.open(path + image)
loadedImages.append(img)
return loadedImages
path = os.listdir('.')
imgs = loadImages(path)
for img in imgs:
img.show()
错误:
----------------------------------- ---------------------------- TypeError Traceback(最近一次调用 最后)在 ----> 1 imgs = loadImages(路径) 2 3 用于 imgs 中的 img: 4 img.show()
在 loadImages(路径) 1 def loadImages(路径): 2 ----> 3 imageList = listdir(路径) 4 加载图像 = [] 5 用于 imagesList 中的图像:
TypeError: listdir: path 应该是 string, bytes, os.PathLike or None, 不列出
【问题讨论】:
标签: python image label classification