Python 属性错误:';google.protobuf.pyext._message.RepeatedCompositeCo';对象没有属性';追加';使用tensorflow.keras中的LSTM时

Python 属性错误:';google.protobuf.pyext._message.RepeatedCompositeCo';对象没有属性';追加';使用tensorflow.keras中的LSTM时,python,tensorflow,keras,protocol-buffers,lstm,Python,Tensorflow,Keras,Protocol Buffers,Lstm,在我尝试将LSTM层添加到tensorflow.keras的序列模型的行中,方法如下: from tensorflow.keras import Sequential from tensorflow.keras.layers import Dense, LSTM, Dropout, GRU, TimeDistributed #... modelX1 = Sequential() modelX1.add(LSTM(LSTM_neurons[0],input_shape=(dataX1.shape[

在我尝试将LSTM层添加到tensorflow.keras的序列模型的行中,方法如下:

from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense, LSTM, Dropout, GRU, TimeDistributed
#...
modelX1 = Sequential()
modelX1.add(LSTM(LSTM_neurons[0],input_shape=(dataX1.shape[1],dataX1.shape[2]), activation='tanh', recurrent_activation='tanh', use_bias=True, return_sequences = True))     
出现以下错误:

File "C:\Users\mroso\Anaconda3\lib\site-packages\tensorflow_core\python\ops\resource_variable_ops.py", line 168, in _variable_handle_from_shape_and_dtype handle_data.shape_and_type.append(

AttributeError: 'google.protobuf.pyext._message.RepeatedCompositeCo' object has no attribute 'append'
我使用的是Tensorflow 2.1.0、protobuf 3.11.4、Spyder 4,我使用的是Windows 10。 当我使用Tensorflow 1.4(90%确定,这就是这个版本)时,一切都正常。 有人知道如何修复此错误吗?
提前感谢您的帮助。

您可能需要查看此处所述的解决方案


正如解决方案所建议的那样,您可以尝试将TensorFlow版本回滚到2.0.0

您可能希望查看下面所述的解决方案


正如解决方案所建议的,您可以尝试将TensorFlow版本回滚到2.0.0

谢谢,上周末我已将我的整个电脑安装好,再次使用TensorFlow版本1.15安装anaconda,现在一切正常。:)欢迎@MaciekRosoł。如果你觉得这很有用,你可能想投一票。谢谢谢谢你,上周末我已经安装了我的整个电脑,用TensorFlow 1.15版再次安装了anaconda,现在一切都正常了。:)欢迎@MaciekRosoł。如果你觉得这很有用,你可能想投一票。谢谢