Error in creating model

in section 4 ( Create and Train the Model ) the code give error
model = util.unet_model_3d(loss_function=soft_dice_loss, metrics=[dice_coefficient])
NotImplementedError: Cannot convert a symbolic Tensor (activation_15/Sigmoid:0) to a numpy array.
even thought all the cells prviews to this has no error

1 Like

Hi @lina_ahmed,

So over here, 2 functions are being called, right ? soft_dice_loss and dice_coefficient. This narrows down that error is in one of these functions. Now, the error is telling that it cannot change a tensor to numpy array. You might have used a numpy fucntion in one/both of the functions, when it is not required. I believe you have to work with Tensorflow/Keras functions.


thanks , found it , i was using np

1 Like