serving icon indicating copy to clipboard operation
serving copied to clipboard

error: 'Expected size[1] in [0, 21], but got 25\n\t [[{{node FPN_slice_lvl4/narrow_to/Slice}}]]'

Open MahdiEsf opened this issue 6 years ago • 4 comments

I have built docker serving MLK images with the latest updates released recently https://github.com/tensorflow/serving/tree/master/tensorflow_serving/tools/docker. Now that I want to make predictions with CPU serving images using fine tuned Mask-RCNN model, I get the following error:

error: 'Expected size[1] in [0, 21], but got 25\n\t [[{{node FPN_slice_lvl4/narrow_to/Slice}}]]'

This error is more frequent with images of relatively bigger size (>1000-pixel width/height), whereas I get right predictions on smaller-size images. BTW, the model was trained on images of different sizes. Also, I saw a previously reported issue in 2018 during training time which is similar to my issue: https://github.com/tensorflow/models/issues/4981

MahdiEsf avatar Jun 22 '20 19:06 MahdiEsf

In order to expedite the trouble-shooting process, please provide a code snippet to reproduce the issue reported here. Thanks!

rmothukuru avatar Jun 23 '20 09:06 rmothukuru

@rmothukuru What code snippet are you specifically asking for? I basically trained a mask-RCNN model and exported its tar file in S3 using a training docker image (had to set MODE_MASK=False in the training bash command since I do not need object segmentation as: python train.py --config DATA.BASEDIR=/opt/ml/input/data/training MODE_FPN=True MODE_MASK=False
"DATA.VAL=('any_val',)" "DATA.TRAIN=('any_train',)".......

Also, set cfg.MODE_MASK = False at the end of training phase where model artifact is exported for serving as: ..... cfg.DATA.BASEDIR = '/opt/ml/input/data/training' cfg.DATA.VAL=('any_val',) cfg.DATA.TRAIN=('any_train',) cfg.MODE_FPN = True cfg.MODE_MASK = False......)

I used serving codes here https://github.com/tensorflow/serving/tree/master/tensorflow_serving/tools/docker to build cpu serving docker image and predictions are successful on low-size images but throws the above error on higher-size images!

MahdiEsf avatar Jun 24 '20 23:06 MahdiEsf

Hi @MahdiEsf,

Would it be possible to share the request that triggers the error?

christisg avatar Jul 10 '20 15:07 christisg

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

rmothukuru avatar Oct 16 '20 10:10 rmothukuru