基于Keras搭建CNN+LSTM模型对RNA和蛋白质作用对进行分类
在初始阶段我直接将LSTM接在了CNN模型的下边,但因为此刻输出的X.shape是(None,384),而LSTM需要三维的输入,所以程序跳出:ValueError:Input 0 is incompatible with layer lstm_1: expected ndim=3,found ndim=2的错误,如下图:
所以需要更改输出的x的维度,修改之后的程序如下图:
修改之后程序即可正常运行,此时输出的x.shape是(None,384,1)