Mask_RCNN icon indicating copy to clipboard operation
Mask_RCNN copied to clipboard

Why is val_loss computed differently than training loss, and how ?

Open Wats0ns opened this issue 4 years ago • 5 comments

Hello, I understand that the training loss is the sum of all the network losses. However, that doesn't seem to be the case for the val_loss, but I can't find any information about this

A simple example: 3600/3600 [==============================] - 1914s 532ms/step - loss: 0.8277 - rpn_class_loss: 0.0072 - rpn_bbox_loss: 0.1687 - mrcnn_class_loss: 0.2845 - mrcnn_bbox_loss: 0.1520 - mrcnn_mask_loss: 0.2153 - val_loss: 0.6929 - val_rpn_class_loss: 0.0070 - val_rpn_bbox_loss: 0.2407 - val_mrcnn_class_loss: 0.3982 - val_mrcnn_bbox_loss: 0.1687 - val_mrcnn_mask_loss: 0.2139 Sum of all the validation losses: 0.0070 + 0.2407 + 0.3982 + 0.1687 + 0.2139 = 1,0285, but it says that val_loss = 0.6929 Any ideas ?

Wats0ns avatar Apr 04 '20 17:04 Wats0ns

Hi, I have the same question. Did you find out why it's different?

teeinn avatar Jun 11 '20 08:06 teeinn

No :/

Wats0ns avatar Jun 17 '20 15:06 Wats0ns

@Wats0ns @teeinn any issue with information on all metrics? I need to interpret them Thank you

yoya93 avatar Jun 18 '20 19:06 yoya93

I faced the same issue when using keras==2.3.1. After downgrading keras to 2.2.5, the val_loss seems to be computed correctly now. I found the solution from this relevant keras issue.

HyuPete avatar Dec 03 '20 17:12 HyuPete

@Wats0ns @teeinn @yoya93 please what was your solution. referred to @HyuPete I tried to downgrade the version of Keras but i got many exception while trainning.

Epoch 15/100
200/200 [==============================] - 4991s 25s/step - loss: 0.9983 - rpn_class_loss: 0.0057 - rpn_bbox_loss: 0.2612 - mrcnn_class_loss: 0.2413 - mrcnn_bbox_loss: 0.1756 - mrcnn_mask_loss: 0.3146 - val_loss: 17.0471 - val_rpn_class_loss: 0.2228 - val_rpn_bbox_loss: 3.0422 - val_mrcnn_class_loss: 0.5213 - val_mrcnn_bbox_loss: 0.6150 - val_mrcnn_mask_loss: 0.3119

I am using

tensorflow==2.2.0 keras==2.3.1

Please i need some help Thanks

babanthierry94 avatar May 03 '22 07:05 babanthierry94