我看到以下错误,这是什么意思以及如何解决?
<ipython-input-205-0168dbb1480c> in hidden_layer(batch_size, input_data)
2
3 cell= tf.contrib.rnn.RNNCell(1)
----> 4 state = cell.zero_state(batch_size=batch_size, dtype=tf.float32)
5
6 with tf.variable_scope("RNN"):
/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/rnn_cell_impl.py in zero_state(self, batch_size, dtype)
283 # Try to use the last cached zero_state. This is done to avoid recreating
284 # zeros, especially when eager execution is enabled.
--> 285 state_size = self.state_size
286 is_eager = context.executing_eagerly()
287 if is_eager and hasattr(self, "_last_zero_state"):
/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/rnn_cell_impl.py in state_size(self)
254 or TensorShapes.
255 """
--> 256 raise NotImplementedError("Abstract method")
257
258 @property
NotImplementedError: Abstract method
给出错误的代码如下:
def hidden_layer(batch_size, input_data):
cell= tf.contrib.rnn.RNNCell(1) state = cell.zero_state(batch_size=batch_size, dtype=tf.float32)
with tf.variable_scope("RNN"):
tf.get_variable_scope().reuse_variables()
output_cell, status = cell(fl[0], state)
input_data = input_data.append(output_cell)
fcl = tf.contrib.layers.fully_connected( ...omit... )
return fcl