keras自编码器网络如何重构?

图片说明
我想通过训练好的自编码器提取中间黄色的特征,然后再把中间的黄色特征放入lstm网络中训练,请问应该怎么做呢?
我是把训练好的模型前三层提取成一个切割模型,然后把它的输出放到lstm里面,但是构建模型的时候还是有问题。

trainX_new = trainX.reshape(trainX.shape[0],trainX.shape[1],1)
testX_new = testX.reshape(testX.shape[0],testX.shape[1],1)
ip = Input(shape=(15,1))
ta = tf.convert_to_tensor(y)
op = LSTM(3)(ta)
print(op)
out = Dense(1, activation='sigmoid')(op)
model = Model(ip, out)
model.summary()
model.compile(loss='mean_absolute_error', optimizer='adam', metrics=['accuracy'])
history = model.fit(trainX_new, trainY, epochs=200, batch_size=32,verbose=2, validation_data=(testX_new, testY))

这里y就是autoencoder的输出
错误:'NoneType' object has no attribute '_inbound_nodes'

谁知道我应该怎么建正确的网络?

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^