源代码:
原因:
tensorflow2.之后的代码的一些改版,而自己找的源码还是使用的tensorflow1.版本
解决方法:
先覆盖掉2.0后的版本
import tensorflow.compat.v1 as tf tf.disable_v2_behavior()
https://tensorflow.google.cn/api_docs/python/tf/compat/v1/nn/rnn_cell/LSTMCellhttp://tensorflow官网打开tensorflow官网,搜索你1.中使用的函数,进行替换



