Issue
How to rewrite this one in tensorflow2? Tried using tf_upgrade_v2
it failed. Tried also with tf.keras.layers.Dropout
but had some issues converting MultiRNNCell
to tensor
rnn_cells = tf.compat.v1.nn.rnn_cell.MultiRNNCell(
[lstm_cell(size_layer) for _ in range(num_layers)],
state_is_tuple = False,
)
drop = tf.contrib.rnn.DropoutWrapper(rnn_cells, output_keep_prob = forget_bias)
Solution
I replaced:
drop = tf.contrib.rnn.DropoutWrapper(rnn_cells, output_keep_prob = forget_bias)
With:
drop = tf.compat.v1.nn.rnn_cell.DropoutWrapper(rnn_cells, output_keep_prob = forget_bias)
And it worked
Answered By - user16965639
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.