AttributeError: ‘Node‘ object has no attribute ‘output_masks‘

出现这个错误的原因是头文件引用的不一样

全部改成Keras的引用就好了。

from tensorflow.keras.layers import Masking, Dense, Input, Flatten
from tensorflow.keras.layers import Conv1D, GlobalMaxPooling1D,Embedding, Dropout, LSTM, GRU, Bidirectional
from tensorflow.keras.models import Sequential, Model
改为:
from keras.layers import Dense, Input, Flatten, Masking
from keras.layers import GlobalMaxPooling1D, Embedding, LSTM, GRU, Bidirectional
from keras.models import Model

你可能感兴趣的:(问题解决,Keras,tensorflow)