orobix / retina-unet

Retina blood vessel segmentation with a convolutional neural network
1.26k stars 468 forks source link

Error when checking model target: expected activation_1 to have 3 dimensions, but got array with shape (30, 1, 160, 160) #27

Closed saeedalahmari3 closed 6 years ago

saeedalahmari3 commented 7 years ago

I'm new to deep learning, I have this error, it is clearly the target images needs to be in different shape. However, since I'm doing augmentation using (.flow_from_directory) for both the images and the masks. How can I reshape target (mask) to be as same as activation results? Notice I getting generator after augmentation. Any idea?

permute_1 (Permute) (None, 25600, 2) 0 reshape_1[0][0]


activation_1 (Activation) (None, 25600, 2) 0 permute_1[0][0]

your help is greatly appreciated. Thanks.

pythonokai commented 7 years ago

Hi, This code is developed by @lantiga @dcorti , I am learning as you are.

check #21, function 'mask_Unet()' may can help. you can expand (30, 1, 160, 160) to (30, 2, 160, 160) then reshape and transpose to (30, 25600, 2).

hope this can help you.

gingerly commented 7 years ago

I think, I too had seen a similar error, but changing backend to tensorflow got rid of it.