model = Sequential()
model.add(LSTM(50,activation='relu',input_shape=(1,1)))
model.add(Dense(1))
model.compile(optimizer='adam',loss='mse')
print(model.summary())
使用keras搭建简单的LSTM神经网络的时候报错:
WARNING:tensorflow:Layer lstm will not use cuDNN kernels since it doesn't meet the criteria.
也就是因为不满足条件而无法使用cuDNN加速
查了官网文档对 LSTM 的API如何加速的描述,激活函数需要设置为tanh
解决方法:将activation='relu'改为activation='tanh'即可解决