TF2.1+Python3.6
报错代码
cell = tf.nn.rnn_cell.BasicRNNCell(num_units=128)
报错信息
AttributeError: module ‘tensorflow_core._api.v2.nn’ has no attribute ‘rnn_cell’
修改为
cell = tf.compat.v1.nn.rnn_cell.BasicRNNCell(num_units=128)
解决问题办法
通过查看TF2.1的帮助文档TF2.1 API
over