ValueError:维度0的切片索引0超出范围。用于输入形状为[0],[1],[1],[1]的“ strided_slice”(操作:“ StridedSlice”)

时间:2019-12-04 10:55:25

标签: python tensorflow

我在Tensorflow 2.0中使用以下代码:

lstm_cell = tf.keras.layers.LSTM(units=hidden_unit)
lstm_cell = tf.nn.RNNCellDropoutWrapper(
    lstm_cell,
    output_keep_prob=self.dropout_keep_prob)
self._initial_state = lstm_cell.get_initial_state(128, tf.float32)

并收到此错误:

  

ValueError:切片索引0的维度0超出范围。对于输入形状为[0],[1],[1],[1]且计算输入张量为:输入[1] = <0>,输入[2] = <1>的strided_slice(op:StridedSlice),输入[3] = <1>。

0 个答案:

没有答案