sadeepj / crfasrnn_keras

CRF-RNN Keras/Tensorflow version
http://crfasrnn.torr.vision
MIT License
603 stars 170 forks source link

2 root error(s) found. #77

Open ItsCRC opened 3 years ago

ItsCRC commented 3 years ago

Hey there, I added the crfrnn layer to the segmentation model U-Net from https://github.com/qubvel/segmentation_models/blob/master/segmentation_models/models/unet.py library. But at the fit time this error occurs: InvalidArgumentError: 2 root error(s) found. (0) Invalid argument: Incompatible shapes: [524288] vs. [16384] [[node loss_1/crfrnn_loss/custom_loss/mul_1 (defined at /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:3009) ]] [[gradients_1/crfrnn_1/truediv_4_grad/RealDiv/_774]] (1) Invalid argument: Incompatible shapes: [524288] vs. [16384] [[node loss_1/crfrnn_loss/custom_loss/mul_1 (defined at /usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py:3009) ]] 0 successful operations. 0 derived errors ignored. [Op:__inference_keras_scratch_graph_143907]

Function call stack: keras_scratch_graph -> keras_scratch_graph

Here are the last few lines of model summary: decoder_stage4a_conv (Conv2D) (None, 128, 128, 16) 4608 decoder_stage4_upsampling[0][0]


decoder_stage4a_bn (BatchNormal (None, 128, 128, 16) 64 decoder_stage4a_conv[0][0]


decoder_stage4a_relu (Activatio (None, 128, 128, 16) 0 decoder_stage4a_bn[0][0]


decoder_stage4b_conv (Conv2D) (None, 128, 128, 16) 2304 decoder_stage4a_relu[0][0]


decoder_stage4b_bn (BatchNormal (None, 128, 128, 16) 64 decoder_stage4b_conv[0][0]


decoder_stage4b_relu (Activatio (None, 128, 128, 16) 0 decoder_stage4b_bn[0][0]


final_conv (Conv2D) (None, 128, 128, 1) 145 decoder_stage4b_relu[0][0]


sigmoid (Activation) (None, 128, 128, 1) 0 final_conv[0][0]


crfrnn (CrfRnnLayer) [(None, 128, 128, 1) 3 sigmoid[0][0]
input_1[0][0]

Total params: 29,933,108 Trainable params: 29,896,692 Non-trainable params: 36,416

Can anyone help me?