我试图开发一种传感器分类模型,它将两个传感器数据作为输入,每个都是一个大小 DM_sensor.shape:(3450,3,1) NDM_sensor.shape:(3450,3,1) 当我不包括TimeDistributed正常工作,但是当包括TimeDistributed时,它给出了在代码下面提到的错误。
visible1 = Input(shape=(DM_sensor.shape[1:]))
conv11 = (TimeDistributed(Conv1D(padding = 'same', filters = 3, kernel_size
= 3, activation = 'relu')))(visible1)
pool11 = MaxPooling1D(pool_size = 2)(conv11)
flat1 = Flatten()(pool11)
visible2 = Input(shape=(NDM_sensor.shape[1:]))
conv21 = (TimeDistributed(Conv1D(padding = 'same', filters = 3, kernel_size
= 3, activation = 'relu')))(visible2)
pool21 = MaxPooling1D(pool_size = 2)(conv21)
flat2 = Flatten()(pool21)
merge = concatenate([flat1, flat2])
# interpretation model
hidden1 = Dense(10, activation='relu')(merge)
hidden2 = Dense(10, activation='relu')(hidden1)
output = Dense(num_classes,activation='softmax')(hidden2)
model = Model(inputs=[visible1, visible2], outputs=output)
# summarize layers
print(model.summary())
IndexError: tuple index out of range