C1_W3_assignment_exercise:1

Extracting (2, 2, 2) sub-volume

Error: Wrong shape. for variable 0.
Error: Wrong shape. for variable 1.
Error: Wrong output.

AssertionError: Not all tests were passed for get_sub_volume. Check your equations and avoid using global variables inside the function.

I tried to figure out the cause of this error but didnot come to know where I am doing wrong in the function , as this function is also useful to run next exercise functions , any idea/help where I am lagging

Thanks

Hi @Rehan_Ahmed,

Although I don’t know the details of your code, the error message indicates the variable shape is NOT appropriate.
Did you check the shape of the variable?
If not, it may be helpful whether the variable shape is the one you supposed.

Keep learning!

Hi @nakamura

yeh , I resolved the shape error , now I am just getting an output error

As I can’t share code on forum can u please go through my lab
labid: wrenygmb

Hi @Rehan_Ahmed,

I’m glad to hear you resolved the shape error!
Regarding the output value, is it the one you are supposed?

@nakamura
yes Error: Wrong output. for variable in position 0.
Error: Wrong output. for variable in position 1.

Hi @Rehan_Ahmed,

As described in the assignment description and hints, it may be a good idea to check whether the value axes are correct and whether the output values are as expected.

I recommend printing each variable value and checking it.

@nakamura , can I share with you py.file of code I tried the same as you recommend but didnot get , although I have completed next 5 exercise but cant submit notebook due to this one , when I try to submit eror arise

Cell #7. Can’t compile the student’s code. Error: AssertionError(‘Not all tests were passed for get_sub_volume. Check your equations and avoid using global variables inside the function.’,)

Thanks

Thanks I have submitted my notebook , I didnot get full grades even though cleared All the tests 6/6,
anyways its done

the mistake I was doing was just in np.random.randint() , I was giving the exact length as np.random.randint() gives (0,range-1) so the only thing I was missing is +1

This may be helpful for someone
Thanks

2 Likes