[英]TFLearn “cannot feed value of shape.”
I started using a very basic Deep Belief Network in Node.js but it wasn't fast enough. 我开始在Node.js中使用一个非常基本的“深层信仰网络”,但是速度不够快。 Essentially it was using a
X
and Y
where each is an array of arrays; 本质上,它使用的是
X
和Y
,其中每个都是数组的数组; X
is the data to train and Y
is the result. X
是要训练的数据, Y
是结果。
So I would feed it something like var x=[[1,2,3], [1,3,2]]
etc. etc. and y=[[1,0], [1,0]]
. 因此,我可以使用
var x=[[1,2,3], [1,3,2]]
等等等和y=[[1,0], [1,0]]
。 Then I would give some data such as [2,3,1]
and it would predict the y
. 然后,我将提供诸如
[2,3,1]
数据,它将预测y
。
I'm lost on how to do this in tfslearn. 我不知道如何在tfslearn中执行此操作。 I can learn on my own but I've hit a point where I'm not sure what to even Google.
我可以自己学习,但遇到了甚至连Google都不确定的问题。
I can get the examples working if it's just a single array. 如果只是单个数组,我可以使示例工作。
Every time I try using an array of arrays I get: 每当我尝试使用数组数组时,都会得到:
cannot feed value of shape
无法提供形状的价值
I was setting the input shape incorrectly for my data set. 我为我的数据集设置了错误的输入形状。 This helped a lot: http://tflearn.org/tutorials/quickstart.html
这很有帮助: http : //tflearn.org/tutorials/quickstart.html
# Data loading and preprocessing
# Building deep neural network
net = tflearn.input_data(shape=[None, 4])
net = tflearn.fully_connected(net, 32)
net = tflearn.fully_connected(net, 32)
net = tflearn.fully_connected(net, 1, activation='softmax')
net = tflearn.regression(net)
# Training
model = tflearn.DNN(net)
model.fit(X, Y, n_epoch=10, batch_size=16, show_metric=True)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.