Week1 Improvise_a_Jazz_Solo - Pass all the tests but Grader says No

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???

@ edwardyu see you’re recently active mentor in this course , sorry for bothering but Can you tell me where the problem come from?

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

1 Like

@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

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

1 Like

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.

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”

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

1 Like

What exactly do you mean by “hidden exercises”?

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.

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!

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

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.

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

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!

Have you read this thread:

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?

In Step 3, be sure you’re using the n_values variable.

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

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.

That request has been made.