Keras-retinanet: Error loading the 'ClipBoxes' layer

Created on 18 Apr 2018  路  9Comments  路  Source: fizyr/keras-retinanet

Hi, I have been using this software for quite a while. In the recent version, I am facing the following error during inference while loading the model. Surprisingly, training worked fine.

ValueError: Unknown layer: ClipBoxes

Most helpful comment

If you convert it to an inference model you have the option of adding NMS.

All 9 comments

Hey, did you convert your model to an inference model?

https://github.com/fizyr/keras-retinanet#converting-a-training-model-to-inference-model

Also, what command are you running to load your model?

Hi, Thanks for your prompt reply. No, I did not convert the inference model. As in the previous version, training models can be directly used for the test, I skipped that. Now I notice the updated README file. Thanks for the reference. I will try that.

I am loading the model using the following commands

model_path = 'path_to_model/resnet101_csv_21.h5'
model = keras.models.load_model(model_path, custom_objects=custom_objects)

True, we changed it not so long ago because it caused some odd things. During training some outputs had to be ignored and during testing the inverse had to be ignored. It's an extra step, but it streamlines the models more.

Hi, I tried converting model, but it did not work for the already trained model. Perhaps it is because of the version mismatch. Any suggestion how to convert the already trained models such it can be used for inference using the new version of the repo? Thank you.

Yeah there's a little trick to update a model:

  • Create a new model (using resnet50_retinanet for instance)
  • Load weights using model.load_weights(weights_path, by_name=True)
  • Save new model

Ok, I will try this. Thanks for the help!

Hi, I got the problem solved. Thanks for your help!
With the new version, the number of detections per image is much higher than the older version:
389205 now compared to only 300 in the previous version.
Any particular reason for that.
Alos, I was wondering if its possible to run non-maxima suppression on the output detections.

If you convert it to an inference model you have the option of adding NMS.

Ok, Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Doodle1106 picture Doodle1106  路  3Comments

sumeetssaurav picture sumeetssaurav  路  4Comments

ztf-ucas picture ztf-ucas  路  3Comments

xyiaaoo picture xyiaaoo  路  5Comments

mayur-who picture mayur-who  路  5Comments