-1
如何格式化数据集以在Python中进行培训?如何格式化数据集以进行Python培训?
我有一些手写数字的3000灰度BMP图像(就像MNIST)。现在我想用这个数据集来训练我的模型(我正在使用Keras库),并且我正在使用卷积神经网络进行训练。
我使用此代码图像中的一个转换成阵列
`import numpy
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
img = Image.open(open('CMATERdb 3.3.1\Ad02599.bmp')).convert("L")
print(img.format, img.size, img.mode)
img = numpy.asarray(img)/255.
imgplot = plt.imshow(img)`
和从代码的结果是
无(32,32)L-
image from the 3000 image want to convert into dataset
任何帮助我如何转换所有图像,并把它们放在相同的MNIST数据格式将是h高度赞赏。
嗨,阿里,欢迎来到SO。这太不确定和广泛。请看看这个改进你的问题:https://stackoverflow.com/help/how-to-ask – petezurich