I am trying to train a model based on a number of txt. file with 2623 lines of numbers. The model is as follows:
input_img = Input(shape=(2623,1), name='input')
x = Conv1D(32, 3, activation='relu', padding='same', use_bias=False)(input_img)
x = BatchNormalization(axis=-1)(x)
x = MaxPooling1D(2, padding='same')(x)
x = Conv1D(16, 3, activation='relu', padding='same', use_bias=False, input_shape=(2623,1))(x)
x = BatchNormalization(axis=-1)(x)
x = MaxPooling1D(2, padding='same')(x)
x = Conv1D(16,3, activation='relu', padding='same', use_bias=False, input_shape=(2623,1))(x)
x = BatchNormalization(axis=-1)(x)
encoded = MaxPooling1D(2, padding='same')(x)
x = Conv1D(16,3, activation='relu', padding='same', use_bias=False, input_shape=(2623,1))(encoded)
x = BatchNormalization(axis=-1)(x)
x = UpSampling1D(2)(x)
x = Conv1D(16,3, activation='relu', padding='same', use_bias=False, input_shape=(2623,1))(x)
x = BatchNormalization(axis=-1)(x)
x = UpSampling1D(2)(x)
x = Conv1D(32, 3, activation='relu', padding='same', use_bias=False, input_shape=(2623,1))(x) #input_shape=(30, 1))
x = BatchNormalization(axis=-1)(x)
x = UpSampling1D(2)(x)
decoded = Conv1D(3, 3, activation='sigmoid', padding='same', use_bias=False,input_shape=(2623,1))(x)
autoencoder = Model(input_img, decoded)
autoencoder.compile(optimizer='rmsprop', loss='binary_crossentropy')
x = Input(shape=(16, 300), name="input")
h = x
h = Conv1D(filters=300, kernel_size=16,
activation="relu", padding='same', name='Conv1',input_shape=(2623,1))(h)
h = MaxPooling1D(pool_size=16, name='Maxpool1')(h)
Whenever i try to fit the model with the following code i get an error saying: Error when checking target: expected conv1d_283 to have shape (2624, 1) but got array with shape (2623, 1)
I tried different padding and setting the input space smaller but it does not seem to work. I do not get the error because whatever i do in the end i have an error for different dimensions. Any ideas?
history = autoencoder.fit(train, train,
epochs=100,
batch_size=256,
shuffle=True,
validation_data=(test, test))
encoded? Also there are multipleConv1Ds. Check which of them is giving the error.