【发布时间】:2016-05-06 13:51:59
【问题描述】:
这里是tensorflow中张量的定义:
word_weight = tf.get_variable("word_weight", [word_num])
x_index = tf.placeholder(tf.int32, [None, sentence_length, 1])
当我尝试时:
word_weight[0] 或 word_weight[1] 或其他,它有效,我可以得到结果。但是当我尝试word_weight[x_index[0,0,0]] 时,我得到了错误:
TypeError: Bad slice index Tensor("modle/RNN/Squeeze_1:0", shape=(), dtype=int32) of type <class 'tensorflow.python.framework.ops.Tensor'>
【问题讨论】:
标签: python tensorflow deep-learning