TypeError: unsupported operand type(s) for +=: ‘Dense‘ and ‘str‘

tensorflow2.0报这个错误
TypeError: unsupported operand type(s) for +=: ‘Dense‘ and ‘str‘_第1张图片因为你在定义模型的时候

model = Sequential(
        SimpleRNN(3),
        Dense(5, activation='softmax')
)

是不是感觉少了点什么,没加[]

model = Sequential([
        SimpleRNN(3),
        Dense(5, activation='softmax')]
)

你可能感兴趣的:(人工智能,python,tensorflow)