我正在尝试制作普什图数字的MNIST这样的数据集,但出现此错误
对于os.listdir(path)中的文件名:
NotADirectoryError:[WinError 267]目录名称无效:
我的代码在这里
Names = [['D:\\myResearchData\\jpg_to_mnist\\training_images','train'], ['D:\\myResearchData\\jpg_to_mnist\\test-images','test']]
for name in Names:
data_image = array('B')
data_label = array('B')
FileList = []
for dirname in os.listdir(name[0])[1:]:
path = os.path.join(name[0],dirname)
for filename in os.listdir(path):
if filename.endswith(".bmp"):
FileList.append(os.path.join(name[0],
dirname,filename))
shuffle(FileList) # Usefull for further segmenting the validation set