# Week 4 Grading Shape Error

**URL:** <https://community.deeplearning.ai/t/week-4-grading-shape-error/153985>\
**Category:** Sequences, Time Series and Prediction\
**Tags:** week-module-4\
**Created:** [July 4, 2022, 4:30am UTC](https://community.deeplearning.ai/t/week-4-grading-shape-error/153985 "2022-07-04T04:30:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rietaros](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@rietaros](https://community.deeplearning.ai/u/rietaros)\
**Post date:** [July 4, 2022, 4:30am UTC](https://community.deeplearning.ai/t/week-4-grading-shape-error/153985/1 "2022-07-04T04:30:51Z")

</div>

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

Hints, I change the original code from  
rnn\_forecast = rnn\_forecast[G.SPLIT\_TIME - G.WINDOW\_SIZE:-1]  
to  
rnn\_forecast = rnn\_forecast[G.SPLIT\_TIME - G.WINDOW\_SIZE:-1,0]

to make sure the metrics can be calculated, but after I submit my grade was 0, Even I have made reach the MAE.

Any idea how to fix?

My model summary

Model: “sequential\_12”

* * *

# Layer (type) Output Shape Param #

conv1d\_12 (Conv1D) (None, None, 60) 360

lstm\_24 (LSTM) (None, None, 60) 29040

lstm\_25 (LSTM) (None, None, 60) 29040

dense\_36 (Dense) (None, None, 30) 1830

dense\_37 (Dense) (None, None, 10) 310

dense\_38 (Dense) (None, None, 1) 11

lambda\_12 (Lambda) (None, None, 1) 0

=================================================================  
Total params: 60,591  
Trainable params: 60,591  
Non-trainable params: 0

---

<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 4, 2022, 6:36am UTC](https://community.deeplearning.ai/t/week-4-grading-shape-error/153985/2 "2022-07-04T06:36:41Z")

</div>

Do not change code other than places where you’re asked to.

See the differences in `BATCH_SIZE` and `WINDOW_SIZE`

This is the definition of class G in the starter code:

```auto
@dataclass
class G:
    TEMPERATURES_CSV = './data/daily-min-temperatures.csv'
    times, temperatures = parse_data_from_file(TEMPERATURES_CSV)
    TIME = np.array(times)
    SERIES = np.array(temperatures)
    SPLIT_TIME = 2500
    WINDOW_SIZE = 64
    BATCH_SIZE = 256
    SHUFFLE_BUFFER_SIZE = 1000

```

This is the version in your notebook:

```auto
@dataclass
class G:
    TEMPERATURES_CSV = './data/daily-min-temperatures.csv'
    times, temperatures = parse_data_from_file(TEMPERATURES_CSV)
    TIME = np.array(times)
    SERIES = np.array(temperatures)
    SPLIT_TIME = 2500
    WINDOW_SIZE = 30
    BATCH_SIZE = 32
    SHUFFLE_BUFFER_SIZE = 1000

```

Similarly, you’ve changed code in `windowed_dataset`. This is the version in starter code:  
`ds = ds.map(lambda w: (w[:-1], w[-1]))`  
This is your notebook version:  
`ds = ds.map(lambda w: (w[:-1], w[1:]))`.

I recommend you start with a fresh copy of the assignment and code only at the right places.  
See `Refresh your Lab Workspace` section [here](https://www.coursera.support/s/article/360044758731-Solving-common-issues-with-Coursera-Labs?language=en_US)

---

<div class="post-metadata">

**Author:** ![rietaros](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@rietaros](https://community.deeplearning.ai/u/rietaros)\
**Post date:** [July 4, 2022, 7:37am UTC](https://community.deeplearning.ai/t/week-4-grading-shape-error/153985/3 "2022-07-04T07:37:09Z")

</div>

Hi, I changed my code because having trouble in calculating MAE and have the error message for my jupyter lab.

I send you the original code (without changing anything original, but it have error on calculating mae)

---

<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 4, 2022, 8:13am UTC](https://community.deeplearning.ai/t/week-4-grading-shape-error/153985/4 "2022-07-04T08:13:16Z")

</div>

Just saw your notebook. Adjust your model architecture to produce the expected output shape.
