Data type error in UNet_Segmentation.py
Hello sir,
I am getting a data type error while using UNet_Segmentation.py.
In line number 258: weights = (y_true *( weighting - 1)) + 1 TypeError: Expected uint8 passed to parameter 'y' of op 'Mul', got float instead.
Regards, Shailendra
Hello @Shailendra-IISc ,
are you using the correct Tensorflow version? When I tested the code with the specified version it ran fine for me, but I remember getting this error later when I upgraded to a newer Tensorflow version.
In any case, please try casting the masks to float by changing line 155 in the file UNet_segmentation.py from
return mask
to
return mask.astype('float32')
Best,
Bastian
Thank you, Bastian sir for the help. I am using Tensorflow 2.8.2 in Google CoLab GPUs. It is working now after implementing the suggested corrections.
Regards, Shailendra