C1_W3 Question about tensorflow

Hi, I am not really familiar with Tensorflow, so I struggle with the assignment. Can someone help me to fix this?
I’ve already done the multi_class dice loss function, and it’s passed all cases. However, it gets an error when creating a model via util.unet_model_3d(). I found out the problem is that the shape of the pred tensor here is [?,?,?], so it cannot get the number of classes, which I use the calculate the dice loss. I haven’t seen anything like this with pytorch. So, can anyone give me an idea about this?

Hello @Quang_Hien_Tran, thanks for reaching out.
Can you send me your notebook, please?

my lab id is qpkpiyya

Can you send me the .ipynb file privately instead?

Hi @Quang_Hien_Tran, I received your code successfully.

For Exercise 5 - soft_dice_loss:
You don’t have to loop through the different classes, simply follow the following equation:

image

I want you to remove the loop and do simple calculations as you did in Exercise 3, it only takes 3 lines of code.