A_0xl
2021-06-28 15:11
采纳率: 40%
浏览 67
已采纳

python深度学习keras,看不懂报错?

from keras.models import Sequential
from keras.layers import Dense,Activation

model = Sequential([
    Dense(32,input_shape=(784,)),
    Activation('relu'),
    Dense(10),
    Activation('softmax'),
])

model = Sequential()
model.add(Dense(32, input_dim=784))
model.add(Activation=('relu'))
--------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-8fbf2d71ffd0> in <module>
      1 model = Sequential()
      2 model.add(Dense(32, input_dim=784))
----> 3 model.add(Activation=('relu'))

~\anaconda3\envs\ten\lib\site-packages\tensorflow\python\training\tracking\base.py in _method_wrapper(self, *args, **kwargs)
    515     self._self_setattr_tracking = False  # pylint: disable=protected-access
    516     try:
--> 517       result = method(self, *args, **kwargs)
    518     finally:
    519       self._self_setattr_tracking = previous_value  # pylint: disable=protected-access

TypeError: add() got an unexpected keyword argument 'Activation'

深度学习小白,刚开始学习keras,想问下这是什么情况应该怎么弄呀

4条回答 默认 最新

相关推荐 更多相似问题