Solved by Latope2-150 in post #9 
              
              
                Hmm, I don’t see anything wrong with these pieces of code. 
For the dice score, I would advise having a dice_score function that returns the dice for each element of the batch, and then doing a mean on the concatenations of all the dices. 
val_dices = []
for val_batch, val_sample in enumerate(val_da…