我正在尝试使用tensorflow将数据提供给CTC LSTM网络,并使用Dataset API将数据提供给占位符。为此,我创建了一个
iterator.get_next()iter_val输出为
(<tf.Tensor 'IteratorGetNext_1:0' shape=(?, ?, 16) dtype=float32>,
<tf.Tensor 'IteratorGetNext_1:1' shape=(?, ?) dtype=int32>,
<tf.Tensor 'IteratorGetNext_1:2' shape=(?, 1) dtype=int32>,
<tf.Tensor 'IteratorGetNext_1:3' shape=(?, 1) dtype=int32>)
我的占位符是
train_inputs = tf.placeholder(tf.float32, [None, None, num_features])
target_inputs = tf.placeholder(tf.int32, [None, None])
seq_len = tf.placeholder(tf.int32, [None,1])
out_len = tf.placeholder(tf.int32, [None,1])
loss = Result of operations of the above placeholders
optimizer = tf.train.GradientDescentOptimizer(0.01)
train = optimizer.minimize(loss)
当我尝试运行会话时
with tf.Session() as sess:
for i in range(num_epochs):
sess.run(iter_val)
_, loss_value = sess.run((train, loss))
print(loss_value)
我得到了错误
InvalidArgumentError:必须输入占位符张量的值 dtype为int32且形状为[?,1] [[node Placeholder_11(定义为:30)]]
我显然没有正确地提供本次会议,所以我如何正确地提供本次会议