# Week1 Improvise\_a\_Jazz\_Solo - Pass all the tests but Grader says No

**URL:** <https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729>\
**Category:** Sequence Models\
**Tags:** coursera-platform\
**Created:** [May 14, 2021, 7:07am UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729 "2021-05-14T07:07:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Novice96](https://avatars.discourse-cdn.com/v4/letter/n/258eb7/32.png) [@Novice96](https://community.deeplearning.ai/u/Novice96)\
**Post date:** [May 14, 2021, 7:07am UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/1 "2021-05-14T07:07:33Z")

</div>

In Improvise\_a\_Jazz\_Solo assignment.  
Despite of the fact that I passed all the tests in 3 programming exercises but when I submit the code the grader says 33/100. I don’t know why???

 ![image](https://global.discourse-cdn.com/dlai/original/2X/7/71c81de452255d7875c6bf517c7b211b6a79f86f.png)

---

<div class="post-metadata">

**Author:** ![Novice96](https://avatars.discourse-cdn.com/v4/letter/n/258eb7/32.png) [@Novice96](https://community.deeplearning.ai/u/Novice96)\
**Post date:** [May 14, 2021, 7:14am UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/2 "2021-05-14T07:14:09Z")

</div>

@ [edwardyu](https://community.deeplearning.ai/u/edwardyu) see you’re recently active mentor in this course , sorry for bothering but Can you tell me where the problem come from?

---

<div class="post-metadata">

**Author:** ![Mubsi](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mubsi/32/94983_2.png) [@Mubsi](https://community.deeplearning.ai/u/Mubsi)\
**Post date:** [May 14, 2021, 7:54am UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/3 "2021-05-14T07:54:16Z")

</div>

Hey @Novice96, can you share the complete output from the grader so we could help you better ? Thanks.

---

<div class="post-metadata">

**Author:** ![Novice96](https://avatars.discourse-cdn.com/v4/letter/n/258eb7/32.png) [@Novice96](https://community.deeplearning.ai/u/Novice96)\
**Post date:** [May 14, 2021, 7:57am UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/4 "2021-05-14T07:57:12Z")

</div>

@Mubsi oh it said something like my functions are incorrect , but I passed all the tests and the functions be able to generate some musics

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

---

<div class="post-metadata">

**Author:** ![Mubsi](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mubsi/32/94983_2.png) [@Mubsi](https://community.deeplearning.ai/u/Mubsi)\
**Post date:** [May 14, 2021, 8:06am UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/5 "2021-05-14T08:06:12Z")

</div>

Oh I see. @Novice96 Can you share your solutions with me in a direct message ? Thanks.

---

<div class="post-metadata">

**Author:** ![virajmadke](https://avatars.discourse-cdn.com/v4/letter/v/dec6dc/32.png) [@virajmadke](https://community.deeplearning.ai/u/virajmadke)\
**Post date:** [May 18, 2021, 1:49pm UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/6 "2021-05-18T13:49:32Z")

</div>

I have the same error. I passed all the tests, and there’s also a musical clip generated. I tried submitting a few times, but it shows the same error.

Here’s the error  
Code Cell UNQ\_C1: Function ‘djmodel’ is correct.  
Code Cell UNQ\_C2: Function ‘music\_inference\_model’ is correct.  
Code Cell UNQ\_C3: Unexpected error (ValueError('operands could not be broadcast together with shapes (13,65) (13,90) ')) occurred during function check. We expected function `predict_and_sample` to return Test 3 failed. Please check that this function is defined properly.  
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.  
This dependency may be the cause of the errors.

---

<div class="post-metadata">

**Author:** ![augustwinds](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@augustwinds](https://community.deeplearning.ai/u/augustwinds)\
**Post date:** [May 22, 2021, 1:12am UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/7 "2021-05-22T01:12:09Z")

</div>

I figured it out, Make sure you follow the instructions for Step 3 to the tee. Especially the one about “Note that for grading purposes: you’ll need to either”

---

<div class="post-metadata">

**Author:** ![Nahammond](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/nahammond/32/1288_2.png) [@Nahammond](https://community.deeplearning.ai/u/Nahammond)\
**Post date:** [May 22, 2021, 2:37am UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/8 "2021-05-22T02:37:31Z")

</div>

I too had score lowered because of 2 hidden exercises, although I had completed all exercises successfully.  
In future, how do I find hidden exercises?  
Thank you

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [May 22, 2021, 3:05am UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/9 "2021-05-22T03:05:23Z")

</div>

What exactly do you mean by “hidden exercises”?

---

<div class="post-metadata">

**Author:** ![LunaticLabs](https://avatars.discourse-cdn.com/v4/letter/l/73ab20/32.png) [@LunaticLabs](https://community.deeplearning.ai/u/LunaticLabs)\
**Post date:** [May 22, 2021, 10:50pm UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/10 "2021-05-22T22:50:56Z")

</div>

I am seeing a similar error the original poster. I had a number of various strange errors while I worked on this exercise, and had to restart the kernel a number of times (at different points) to get it to start working again. Now I’ve got it passing all the unit tests, it generates a musical clip, but when I submit the exercise, it gives me a score of 66% and tells me “Function ‘music\_inference\_model’ is incorrect. Check implementation.”. The other functions pass the tests. My generated music doesn’t sound particularly jazzy, someone else had a post saying it sounded Zelda-ish, which is similar to what I hear. Either way, I’m at a loss. I’ve spent several hours trying to change various things in my music\_inference\_model function to try and get it to pass, but no luck.

---

<div class="post-metadata">

**Author:** ![RichME-ML](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@RichME-ML](https://community.deeplearning.ai/u/RichME-ML)\
**Post date:** [June 14, 2021, 12:14am UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/11 "2021-06-14T00:14:45Z")

</div>

I have the same issue and the music I hear is similar to LunaticLabs’ description.

The shape of pred is (50,1,90) and the shape of results is (50,90) and these are the results I am getting from the test:  
np.argmax(results[12]) = 67  
np.argmax(results[17]) = 13  
list(indices[12:18]) = [array([67]), array([19]), array([26]), array([66]), array([49]), array([13])]

All prior functions passed all tests. Any guidance would be great! Thank you!

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [June 14, 2021, 12:35am UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/12 "2021-06-14T00:35:16Z")

</div>

Do you have any error messages? Or is it just that your sound output does not sound like a piano?

---

<div class="post-metadata">

**Author:** ![RichME-ML](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@RichME-ML](https://community.deeplearning.ai/u/RichME-ML)\
**Post date:** [June 14, 2021, 4:04pm UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/13 "2021-06-14T16:04:02Z")

</div>

Hi MTosh.

Within the workbook I don’t receive any errors but I don’t pass the grader for the last function. Here is the grader output:  
Code Cell UNQ\_C1: Function ‘djmodel’ is correct.  
Code Cell UNQ\_C2: Function ‘music\_inference\_model’ is correct.  
Code Cell UNQ\_C3: Function ‘predict\_and\_sample’ is incorrect. Check implementation.  
If you see many functions being marked as incorrect, try to trace back your steps & identify if there is an incorrect function that is being used in other steps.  
This dependency may be the cause of the errors.

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [June 14, 2021, 5:49pm UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/14 "2021-06-14T17:49:15Z")

</div>

This suggests there is an error in your predict and sample funtion.

---

<div class="post-metadata">

**Author:** ![RichME-ML](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@RichME-ML](https://community.deeplearning.ai/u/RichME-ML)\
**Post date:** [June 14, 2021, 7:47pm UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/15 "2021-06-14T19:47:08Z")

</div>

Hi MTosh, Yes, I believe you are correct but I am not sure what to change as there is no error message. Does the info I provided about my output and shapes of variables provide enough info for suggestions about what to change in the function or would you prefer I post the code and delete it after you have a chance to see it? Thanks!

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [June 15, 2021, 6:18am UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/16 "2021-06-15T06:18:42Z")

</div>

Have you read this thread:

> [@C5 W1 A3: Jazz Improvisation with LSTM (Problem and Tips)](https://community.deeplearning.ai/t/jazz-improvisation-with-lstm-problem/3901/38):
>
> For djmodel(). check these common issues: slicing X correctly. using the “reshaper()” and “densor()” functions with the appropriate arguments. used LSTM\_cell() with the appropriate “inputs=” and “initial\_state=[…]” arguments. For music\_inference\_model(), the common errors are: Instruction 2.D tells you for argmax, use the arguments ‘out’ and ‘axis=-1’, and it says for onehot to use the arguments ‘x’ and ‘depth=n\_values’. Instruction 2.E gives you the exact code to use for RepeatVector. Fo…

---

<div class="post-metadata">

**Author:** ![RichME-ML](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@RichME-ML](https://community.deeplearning.ai/u/RichME-ML)\
**Post date:** [June 15, 2021, 4:20pm UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/17 "2021-06-15T16:20:26Z")

</div>

Hi MTosh, I just read through it and it looks like I am doing everything specified. These are also discussing the preceding functions before predict and sample. The grader gave me full credit for these preceding functions so I was thinking the issue was only with predict and sample. Is the info I providing leading you to believe that my preceding functions are the issue even though the grader said they were correct? Or am I missing something in that thread?

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [June 16, 2021, 4:25pm UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/18 "2021-06-16T16:25:11Z")

</div>

In Step 3, be sure you’re using the n\_values variable.

---

<div class="post-metadata">

**Author:** ![Tihomir\_Kojuharski](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@Tihomir\_Kojuharski](https://community.deeplearning.ai/u/Tihomir_Kojuharski)\
**Post date:** [September 19, 2021, 9:34pm UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/19 "2021-09-19T21:34:08Z")

</div>

I had the same problem - the grader reported that the first two functions are correct:

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

However, the music\_inference\_model function was not, because in the outputs parameter that I passed to the Model constructor was “[outputs]”, instead of just “outputs”. Fixing that solved my problem.

It would be great if you add test for the outputs as well.

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [September 19, 2021, 9:59pm UTC](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729/20 "2021-09-19T21:59:11Z")

</div>

That request has been made.

[Next page](https://community.deeplearning.ai/t/week1-improvise-a-jazz-solo-pass-all-the-tests-but-grader-says-no/5729.md?page=2)
