There was a problem grading your submission. Details: Incompatible shapes: [1150,64] vs. [1150] [Op:SquaredDifference]

There was a problem grading your submission. Details:
Incompatible shapes: [1150,64] vs. [1150] [Op:SquaredDifference]

where would the mistake be when i get this error?

1 Like

Does the error give you the line where the error occurred? If it does then you can check the shape mismatch issue and why you are getting it.

1 Like

it gives an error here:

mse, mae = compute_metrics(series_valid, rnn_forecast)

print(f"mse: {mse:.2f}, mae: {mae:.2f} for forecast")

1 Like

how can i know where is the mistake

2 Likes

It makes sense to check the shape of the arguments of mse= tf.keras.metrics… where the arrow is pointing, the true_series and forecast probably do not have the same shape. I guess the forecast is computed so that is probably the one that is not computed right, find where it is computed and fix that issue. Also I think here the forecast should be the y_pred and true_series the y_true, don’t mix up the position of the arguments when you calculate the mse, the last arrow of the error gives you position of each in the function.

1 Like

is this problem in “create_uncompiled_model” function?

1 Like

@Ahmad-Mustafa
Please don’t create duplicate posts.

2 Likes

sorry i thought i would find a hint there

my create_uncompiled_model function is right

2 Likes

this is the model.summary()

2 Likes

Please click my name and message your notebook as an attachment.

1 Like

the problem was with the LSTM and Dense layers:

i was using (1 Conv1D layer) , (3 Dense layers ) , and (2 LSTM layers), it must be (1 Conv1D layer) , (1LSTM layer ) and (2 Dense layers).

1 Like

can you please send your notebook

1 Like

Why do you need a learner notebook?

1 Like

I have the same problem and do not know how to solve it. Can anyone give me a hand, please? Many thanks.

2 Likes

@Zhi_Yang Just saw your notebook. Model output should have shape (None, 1). Your model has output shape (None, None, 1). Please fix this.

1 Like

please help me i have the same problem
I have sent you my notebook

1 Like

@pratik_domadiya

I just ran your notebook without any error. Seems like you changed the notebook before giving it to me. The error you observed will happen when you specify a certain flag to the LSTM layer.

Please download the notebook you sent me via direct message and run it. Do confirm if you’re still facing issue(s).

1 Like

yeah running perfectly thanks

2 Likes

Have you fixed this error yet? Can you send me your notebook? thank you very much

1 Like

Hi Pratik, could you please share your notebook with me? I am facing the same issue and need

1 Like