tensorflow / tpu

Reference models and tools for Cloud TPUs.
https://cloud.google.com/tpu/
Apache License 2.0
5.21k stars 1.77k forks source link

[models/official/detection] exporting saved_model fails in "[...] Key fpn/l3/bias not found in checkpoint [...]" #782

Open christianscharr opened 4 years ago

christianscharr commented 4 years ago

I tried to export some of the pretrained detection models as a saved_model. Therefore I am using the official docker image tensorflow/tensorflow:1.15.2-gpu-py3.

Every single export fails with the following error: 2020-06-07 21:04:34.666030: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at save_restore_v2_ops.cc:184 : Not found: Key fpn/l3/bias not found in checkpoint

Tried on "detection_retinanet_spinenet-96", "detection_retinanet_spinenet-96-best" and "detection_retinanet_spinenet-143".

christianscharr commented 4 years ago

Ok, I solved it myself... Found out that you are missing the config_file parameter on the instructions page! Downloading the proper config file and adding the config_file parameter solved the error.

https://github.com/tensorflow/tpu/blob/master/models/official/detection/GETTING_STARTED.md#export-to-savedmodel

xianzhidu commented 4 years ago

Thanks Christian for raising this issue. @pengchongjin Can we add descriptions in the guide about configs?

saminheydarian commented 3 years ago

Ok, I solved it myself... Found out that you are missing the config_file parameter on the instructions page! Downloading the proper config file and adding the config_file parameter solved the error.

https://github.com/tensorflow/tpu/blob/master/models/official/detection/GETTING_STARTED.md#export-to-savedmodel

Can you share a sample of the code you executed?

rizavelioglu commented 1 year ago

@christianscharr Were you able to export the checkpoints to saved_model? Currently, I am trying to export the checkpoint attribute_mask_rcnn (fashionpedia-spinenet-143) to a saved_model but couldn't make it so far.

The issue is that the script does not support attribute_mask_rcnn model, see below: https://github.com/tensorflow/tpu/blob/ffe00bc885dc39039ae49357595198607a384800/models/official/detection/export_saved_model.py#L82