tensorflow中我的网络输出层有4个节点,但最终结果只需要用到第4个节点的输出,现在有如下报错,如何解决?

输出层代码

Weights1 = tf.Variable(tf.random_normal([11, 4]))

biases1 = tf.Variable(tf.zeros([1, 4]) + 0.1)
Wx_plus_b1 = tf.matmul(l0, Weights1) + biases1

N1act = 2/(1+pow(math.e,-Wx_plus_b1[3]))-1
prediction = tf_spiky(N1act)

报错信息

raise ValueError(err.message)

ValueError: slice index 3 of dimension 0 out of bounds. for 'strided_slice' (op: 'StridedSlice') with input shapes: [1,4], [1], [1], [1] and with computed input tensors: input[1] = , input[2] = , input[3] = .

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 以帮助更多的人 ^-^