Closed kojack14 closed 1 year ago
This error possibly because of the shape mismatch. For example, the input shape of some of your operations is wrong, or some operations inside the layer, such as matmul, receive the wrong input shape. Please check your code for shape mismatch. The reason for this confusing error message is that missing code to catch shape mismatch errors when matmul and I will revise it.
I got it, thanks. I am using a mixture of UpSampling1D and Conv1D to simulate a Conv1DTranspose , maybe this is causing the error on the decoder part. This is the original python code that I'm trying to implement using C# :
def make_model_conv1d(m): timesteps = parameters[m]['timesteps'] neurons = parameters[m]['neurons'] kernels = parameters[m]['kernels'] channels = fp['channels'] autoencoder = tf.keras.Sequential([ layers.InputLayer(input_shape=(timesteps,channels)), layers.Conv1D(neurons[0] ,kernel_size=kernels[0],activation=layers.LeakyReLU(), padding='same', strides=2), layers.Dropout(rate=0.3), layers.Conv1D(neurons[1] ,kernel_size=kernels[1],activation=layers.LeakyReLU(), padding='same', strides=2), layers.Conv1DTranspose(neurons[1] ,kernel_size=kernels[1], strides=2, activation =layers.LeakyReLU(), padding='same'), layers.Dropout(rate=0.3), layers.Conv1DTranspose(neurons[0] ,kernel_size=kernels[0], strides=2, activation=layers.LeakyReLU(), padding='same'), layers.Conv1DTranspose(channels ,kernel_size=kernels[0], padding='same') #strides=2, ]) autoencoder.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=0.001), loss="mse", metrics=[tf.keras.metrics.RootMeanSquaredError(name='rmse')])
return autoencoder
You're welcome, I'll let you know when Conv1DTranspose is developed.
Description
Does anyone know anything about this error I'm encountering when using the fit method?
Below is this code that I used to generate the model:
public static IModel Conv1DAutoencoder(AICreateParameters aICreateParameters) // sequential model { List layers = new List();
var layer = keras.layers;
var autoencoder = new Sequential(new SequentialArgs() { Name = "Conv1D_Model" });
Alternatives
No response