Keras-retinanet: testing error: 'boxes, scores, labels ' not enough values to unpack (expected 3, got 2)

Created on 13 Jul 2018  路  10Comments  路  Source: fizyr/keras-retinanet

boxes, scores, labels = model.predict_on_batch(np.expand_dims(image, axis=0))

ValueError: not enough values to unpack (expected 3, got 2)

I dont why...can somebody solve it?

Most helpful comment

convert your model into a inference model

All 10 comments

i dont know the difference of the inference model and training model.

run "# Running directly from the repository:
keras_retinanet/bin/convert_model.py /path/to/training/model.h5 /path/to/save/inference/model.h5"

but the h5 file has error : load_model() got an unexpected keyword argument 'convert_model'
I dont know why

I fixed

@luvWY I met the same probelm, could you please tell me how to solve it?

boxes, scores, labels = model.predict_on_batch(np.expand_dims(image, axis=0))

 ValueError: not enough values to unpack (expected 3, got 2)

convert your model into a inference model

@luvWY after convert your model into a inference model,when evaluate,
TypeError: ('Keyword argument not understood:', u'class_specific_filter')

The problem is that the parameter of the load_model function is called convertand not convert_model. Load the inference model like this (Just my example...you need to change the path obv): model = models.load_model('snapshots/resnet50_pascal_03.h5', backbone_name='resnet50', convert=True)

Has this been resolved?

I guess so. If you take a look at the load_model function (https://github.com/fizyr/keras-retinanet/blob/master/keras_retinanet/models/__init__.py) you can see that the parameter to convert the model is defined as convert and not convert_model like in the function call in the example notebook (https://github.com/fizyr/keras-retinanet/blob/master/examples/ResNet50RetinaNet.ipynb).

Everyone who uses the example notebook will have this problem. I made a PR.

Since the PR (#580) is merged, I will close this. Thanks @PhilippMarquardt !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wassname picture wassname  路  6Comments

mayur-who picture mayur-who  路  5Comments

CedarYang picture CedarYang  路  5Comments

remcova picture remcova  路  4Comments

ChienLiu picture ChienLiu  路  6Comments