Skip to content
Advertisement

Python Tensorflow Shape Mismatch (WaveNet)

I was trying to run a WaveNet, which is specified in https://github.com/mjpyeon/wavenet-classifier/blob/master/WaveNetClassifier.py.

Part of my code is as follows:

JavaScript

Here, self.input_shape=X_train.shape and self.output_shape=(11,)

It successfully printed out the model’s summary, but was outputting the following error:

JavaScript

However, my X_train has a shape of (19296, 110250). I was trying to figure out on why the X_train has been reshaped from (19296, 110250) to (32, 110250), but couldn’t find it out.

(19296 is the number of songs and 110250 is a 5 second length audio file with sampling rate of 22050 processed using Python Librosa library)

What is the problem of my code? Thank you in advance!

Advertisement

Answer

Your data is a missing dimension. A Conv1D layer requires the input shape (timesteps, features). You seem to only have the timesteps or features. So maybe try something like this:

JavaScript
JavaScript

Note that I only used one sample but I think you get the idea.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement