C1_W3_Assignment final

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

how we fix this?

hi @chrysa

Kindly go through the below post comment link to do the correction

An usual issue with learners having this kind of error is because their code might be right but the code implemented is not as per how the autograder wants it to be.

Use of incorrect function, or use of global variables or implementing steps not how it was given, like if the steps were divided into 3 steps but you might have written this into single step or vice versa. the key point to pass these assignments is to only replace NONE placed between the markers ###START AND END CODE HERE### with whatever part of codes already given.

kindly go through the linked comment, if you are still unable to clear, then click on my name and message screenshot of the codes which threw assertion error.

Regards
DP

waiting for your reply. thank you.

did you go through the linked comment. also first confirm if you passed all the unittest and if you haven’t, then share screenshot of that error. the error you are mentioning is related to one of the Unittest didn’t passing the grade function you wrote codes.

@chrysa,

there are multiple errors but I will reply after I review your complete grade function codes for single dice coefficient and dice coefficient. I need to see complete screenshot of the their respective grade function. please DM me these two again including the header and arguments within the screenshot.

Regards
DP

based on your latest share of grader output which provides information which codes were incorrect,

for UNQ-C1 grade function code correction refer the below link, your code for one hot label, needs to use the keras categorical function and Use np.moveaxis function to check the dimension, numerical are mentioned correctly in the brackets(below link comments should help you understand how both codes need to be corrected

For UNQ-C3 codes correction, your code implement needs to be the way you implemented in UNQ-C4. Do not include 2 in denominator for the last equation while calculating single soft dice coefficient. 2 need to need to be mentioned for the dice_numerator. compare the code implement with UNQ_C4 codes you wrote. Also in UNQ_C3 you used tf.reduce (incorrect function) where as in c4 you used K.sum. You are suppose to use the same function you used in UNQ_C4 i.e. K.sum.

Let me know if issue still persist.