I have been trying to train a model. I have used MFCC and Spectrogram DSP feature selection, which worked well by extracting the features. However, whenever I start training, I get this reshape error message for either situation. Below is the error message. I need a help about how to fix this.
Error:
Training model…
Training on 10162 inputs, validating on 2541 inputs
Traceback (most recent call last):
File “/home/train.py”, line 288, in
main_function()
File “/home/train.py”, line 217, in main_function
model, disable_per_channel_quantization, akida_model, akida_edge_model = train_model(train_dataset, validation_dataset,
File “/home/train.py”, line 144, in train_model
model.add(Reshape((int(input_length / 40), 40), input_shape=(input_length, )))
File “/app/keras/.venv/lib/python3.8/site-packages/tensorflow/python/trackable/base.py”, line 205, in _method_wrapper
result = method(self, *args, **kwargs)
File “/app/keras/.venv/lib/python3.8/site-packages/keras/utils/traceback_utils.py”, line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File “/app/keras/.venv/lib/python3.8/site-packages/keras/layers/reshaping/reshape.py”, line 118, in _fix_unknown_dimension
raise ValueError(msg)
ValueError: Exception encountered when calling layer “reshape” (type Reshape).
total size of new array must be unchanged, input_shape = [975], output_shape = [24, 40]
Call arguments received by layer “reshape” (type Reshape):
• inputs=tf.Tensor(shape=(None, 975), dtype=float32)
Application exited with code 1
Job failed (see above)