Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- model.fit(mono_X, mono_Y, epochs=10, batch_size=None, verbose=2)
- ValueError when checking input: expected input_47 to have 4 dimensions, but got array with shape (32760, 1)
- spectra = Input(shape=(72, 40, 1))
- # conv1a
- c1a = Conv2D(48, (3,5), activation='relu', padding = 'same')(spectra)
- c1a = BatchNormalization()(c1a)
- c1a = MaxPooling2D(pool_size=(5, 5), strides = 1)(c1a)
- # conv1b
- c1b = Conv2D(32, (3,9), activation='relu', padding = 'same')(spectra)
- c1b = BatchNormalization()(c1b)
- c1b = MaxPooling2D(pool_size=(5, 5), strides = 1)(c1b)
- # conv1c
- c1c = Conv2D(16, (3,15), activation='relu', padding = 'same')(spectra)
- c1c = BatchNormalization()(c1c)
- c1c = MaxPooling2D(pool_size=(5, 5), strides = 1)(c1c)
- # conv1d
- c1d = Conv2D(16, (3,21), activation='relu', padding = 'same')(spectra)
- c1d = BatchNormalization()(c1d)
- c1d = MaxPooling2D(pool_size=(5, 5), strides = 1)(c1d)
- # stack the layers
- merged = keras.layers.concatenate([c1a, c1b, c1c, c1d], axis=3)
- # conv2
- c2 = Conv2D(224, (5,5), activation='relu')(merged)
- c2 = BatchNormalization()(c2)
- c2 = MaxPooling2D(pool_size=(5, 5), strides = 1)(c2)
- # output softmax
- out = Dense(15, activation='softmax')(c2)
- # create Model
- model = Model(spectra, out)
- # apply optimization and loss function
- adam = Adam(lr=0.002, beta_1=0.9, beta_2=0.999, epsilon=None, decay=0.0, amsgrad=False)
- model.compile(optimizer=adam,
- loss='categorical_crossentropy',
- metrics=['accuracy'])
- ValueError: Input 0 is incompatible with layer conv2d_203: expected ndim=4, found ndim=3
Add Comment
Please, Sign In to add comment