我一直在玩Tensorflow库做教程.现在我想玩我自己的数据,但我失败了.这可能是一个noob问题,但我无法弄清楚.
我正在使用这个例子:https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3%20-%20Neural%20Networks/convolutional_network.py
我想使用我自己的图像,将我的图像转换为使用tensorflow我正在使用它:https://github.com/HamedMP/ImageFlow/blob/master/ImageFlow.py
现在我更改示例中的参数:
n_input = 784
n_classes = 10
Run Code Online (Sandbox Code Playgroud)
对此:
n_input = 9216
n_classes = 2
Run Code Online (Sandbox Code Playgroud)
我这样做是因为我的图像是96*96而且我的图像只有两类
我也将重量和偏差改为我需要的数字.
我读了这样的数据:
batch_xs = imgReader.read_images(pathname);
Run Code Online (Sandbox Code Playgroud)
imgReader是ImageFlow文件
但是当我尝试运行它时,我给了我一个错误:
ValueError: Cannot feed value of shape (104, 96, 96, 1) for Tensor
u'Placeholder:0', which has shape (Dimension(None), Dimension(9216))
Run Code Online (Sandbox Code Playgroud)
我觉得我忽视了一些小事但我没有看到它.