对于在 python 中使用 tensorflow 的 softmax 回归程序,我想将我的 1000 个 jpeg 图像文件作为 2D 张量 x:[图像索引,像素索引]。“图像索引”是图像,像素索引是该图像的特定图像像素。模型方程为:
y = tf.nn.softmax(tf.matmul(x, W) + b)
where:
x = tf.placeholder(tf.float32, [None, image_size])
W = tf.Variable(tf.zeros([image_size, classes]))
b = tf.Variable(tf.zeros([classes]))
图像大小 = 图像的高度 * 宽度(所有图像的常量)。
在张量流中以这种形式获取我的图像文件的最佳方法是什么?