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

**URL:** <https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201>\
**Category:** Sequences, Time Series and Prediction\
**Tags:** week-module-4\
**Created:** [July 14, 2022, 7:33am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201 "2022-07-14T07:33:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmad-Mustafa](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@Ahmad-Mustafa](https://community.deeplearning.ai/u/Ahmad-Mustafa)\
**Post date:** [July 14, 2022, 7:33am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/1 "2022-07-14T07:33:29Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![gent.spah](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/gent.spah/32/136423_2.png) [@gent.spah](https://community.deeplearning.ai/u/gent.spah)\
**Post date:** [July 14, 2022, 8:01am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/2 "2022-07-14T08:01:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ahmad-Mustafa](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@Ahmad-Mustafa](https://community.deeplearning.ai/u/Ahmad-Mustafa)\
**Post date:** [July 14, 2022, 8:04am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/3 "2022-07-14T08:04:05Z")

</div>

it gives an error here:

mse, mae = compute\_metrics(series\_valid, rnn\_forecast)

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

---

<div class="post-metadata">

**Author:** ![Ahmad-Mustafa](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@Ahmad-Mustafa](https://community.deeplearning.ai/u/Ahmad-Mustafa)\
**Post date:** [July 14, 2022, 8:15am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/4 "2022-07-14T08:15:24Z")

</div>

how can i know where is the mistake

 ![image](https://global.discourse-cdn.com/dlai/original/3X/9/1/912f3f3cb30105bffb06e5e3a5320ce4dbbcc158.png)

---

<div class="post-metadata">

**Author:** ![gent.spah](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/gent.spah/32/136423_2.png) [@gent.spah](https://community.deeplearning.ai/u/gent.spah)\
**Post date:** [July 14, 2022, 8:26am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/5 "2022-07-14T08:26:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Ahmad-Mustafa](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@Ahmad-Mustafa](https://community.deeplearning.ai/u/Ahmad-Mustafa)\
**Post date:** [July 14, 2022, 8:28am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/6 "2022-07-14T08:28:22Z")

</div>

is this problem in “create\_uncompiled\_model” function?

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [July 14, 2022, 8:44am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/7 "2022-07-14T08:44:33Z")

</div>

@Ahmad-Mustafa  
Please don’t create duplicate [posts](https://community.deeplearning.ai/t/week-4-assignment-shape-error-during-metric-evaluation/134945/13).

---

<div class="post-metadata">

**Author:** ![Ahmad-Mustafa](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@Ahmad-Mustafa](https://community.deeplearning.ai/u/Ahmad-Mustafa)\
**Post date:** [July 14, 2022, 8:54am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/8 "2022-07-14T08:54:38Z")

</div>

sorry i thought i would find a hint there

my create\_uncompiled\_model function is right

 ![image](https://global.discourse-cdn.com/dlai/original/3X/b/2/b2a4e2cb4dc8e740ccbe802633d93639e759ba0e.png)

---

<div class="post-metadata">

**Author:** ![Ahmad-Mustafa](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@Ahmad-Mustafa](https://community.deeplearning.ai/u/Ahmad-Mustafa)\
**Post date:** [July 14, 2022, 9:16am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/9 "2022-07-14T09:16:34Z")

</div>

this is the model.summary()

 ![image](https://global.discourse-cdn.com/dlai/original/3X/4/e/4e1d1d6475bc5b0fe3158e7cf203706842933cc9.png)

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [July 14, 2022, 9:32am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/10 "2022-07-14T09:32:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ahmad-Mustafa](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@Ahmad-Mustafa](https://community.deeplearning.ai/u/Ahmad-Mustafa)\
**Post date:** [July 14, 2022, 10:21am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/11 "2022-07-14T10:21:13Z")

</div>

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) , (1`LSTM` layer ) and (2 `Dense` layers).

---

<div class="post-metadata">

**Author:** ![priyanshu1](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@priyanshu1](https://community.deeplearning.ai/u/priyanshu1)\
**Post date:** [July 16, 2022, 7:24pm UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/12 "2022-07-16T19:24:25Z")

</div>

can you please send your notebook

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [July 17, 2022, 5:16am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/13 "2022-07-17T05:16:38Z")

</div>

Why do you need a learner notebook?

---

<div class="post-metadata">

**Author:** ![Zhi\_Yang](https://avatars.discourse-cdn.com/v4/letter/z/ecd19e/32.png) [@Zhi\_Yang](https://community.deeplearning.ai/u/Zhi_Yang)\
**Post date:** [July 19, 2022, 9:35am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/14 "2022-07-19T09:35:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [July 20, 2022, 8:26am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/15 "2022-07-20T08:26:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pratik\_domadiya](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/pratik_domadiya/32/18368_2.png) [@pratik\_domadiya](https://community.deeplearning.ai/u/pratik_domadiya)\
**Post date:** [August 13, 2022, 7:20pm UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/17 "2022-08-13T19:20:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [August 14, 2022, 8:36am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/18 "2022-08-14T08:36:19Z")

</div>

@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).

---

<div class="post-metadata">

**Author:** ![pratik\_domadiya](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/pratik_domadiya/32/18368_2.png) [@pratik\_domadiya](https://community.deeplearning.ai/u/pratik_domadiya)\
**Post date:** [August 14, 2022, 5:26pm UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/19 "2022-08-14T17:26:59Z")

</div>

yeah running perfectly thanks

---

<div class="post-metadata">

**Author:** ![Anh\_Tuan\_Bui](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@Anh\_Tuan\_Bui](https://community.deeplearning.ai/u/Anh_Tuan_Bui)\
**Post date:** [August 15, 2022, 9:44am UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/20 "2022-08-15T09:44:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![geerishajain1](https://avatars.discourse-cdn.com/v4/letter/g/e19b73/32.png) [@geerishajain1](https://community.deeplearning.ai/u/geerishajain1)\
**Post date:** [September 19, 2022, 3:12pm UTC](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201/21 "2022-09-19T15:12:33Z")

</div>

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

[Next page](https://community.deeplearning.ai/t/there-was-a-problem-grading-your-submission-details-incompatible-shapes-1150-64-vs-1150-op-squareddifference/161201.md?page=2)
