1

I have been using below tensorflow object detection tutorial to build a custom object detector.

https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/index.html

I have run according to the instructions provided in the google colab with GPU support and then in AWS EC2 instance with GPU support. In both of the cases,I am getting warning and model training stops there.

I have used EfficientDet D6 model from tensorflow 2 detection model garden.

Below is the warning which stops the model training.

WARNING:tensorflow:Unresolved object in checkpoint: (root).model._feature_extractor._bifpn_stage.node_input_blocks.7.0.1.1.axis W0910 14:45:44.534728 140520822372160 util.py:203] Unresolved object in checkpoint: (root).model._feature_extractor._bifpn_stage.node_input_blocks.7.0.1.1.axis WARNING:tensorflow:Unresolved object in checkpoint: (root).model._feature_extractor._bifpn_stage.node_input_blocks.7.0.1.1.gamma W0910 14:45:44.534780 140520822372160 util.py:203] Unresolved object in checkpoint: (root).model._feature_extractor._bifpn_stage.node_input_blocks.7.0.1.1.gamma WARNING:tensorflow:Unresolved object in checkpoint: (root).model._feature_extractor._bifpn_stage.node_input_blocks.7.0.1.1.beta W0910 14:45:44.534832 140520822372160 util.py:203] Unresolved object in checkpoint: (root).model._feature_extractor._bifpn_stage.node_input_blocks.7.0.1.1.beta WARNING:tensorflow:Unresolved object in checkpoint: (root).model._feature_extractor._bifpn_stage.node_input_blocks.7.0.1.1.moving_mean W0910 14:45:44.534884 140520822372160 util.py:203] Unresolved object in checkpoint: (root).model._feature_extractor._bifpn_stage.node_input_blocks.7.0.1.1.moving_mean WARNING:tensorflow:Unresolved object in checkpoint: (root).model._feature_extractor._bifpn_stage.node_input_blocks.7.0.1.1.moving_variance W0910 14:45:44.534937 140520822372160 util.py:203] Unresolved object in checkpoint: (root).model._feature_extractor._bifpn_stage.node_input_blocks.7.0.1.1.moving_variance WARNING:tensorflow:A checkpoint was restored (e.g. tf.train.Checkpoint.restore or tf.keras.Model.load_weights) but not all checkpointed values were used. See above for specific issues. Use expect_partial() on the load status object, e.g. tf.train.Checkpoint.restore(...).expect_partial(), to silence these warnings, or use assert_consumed() to make the check explicit. See https://www.tensorflow.org/guide/checkpoint#loading_mechanics for details. W0910 14:45:44.534990 140520822372160 util.py:211] A checkpoint was restored (e.g. tf.train.Checkpoint.restore or tf.keras.Model.load_weights

Any help or pointer is appreciated.

1 Answer 1

1

Use expect_partial() on the load status object,
e.g. tf.train.Checkpoint.restore(...).expect_partial(), to silence these warnings,
or use assert_consumed().
Official Document

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for your response @Deep. However,it seems that expect_partial is useful to load a saved model. model = tf.keras.Model(...) tf.saved_model.save(model, path) # or model.save(path, save_format='tf') checkpoint = tf.train.Checkpoint(model) checkpoint.restore(path).expect_partial(). These are from official guides
I have tried to run SSD MobileNet V2 FPNLite 320x320,and got the below errors. ValueError: Cannot assign to variable WeightSharedConvolutionalBoxPredictor/WeightSharedConvolutionalClassHead/ClassPredictor/bias:0 due to variable shape (66,) and value shape (18,) are incompatible WARNING:tensorflow:Unresolved object in checkpoint: (root).save_counter
After this error,program pointed below warnings and stopped unfortunately. W0916 07:32:58.886545 140440812377920 util.py:203] Unresolved object in checkpoint: (root).save_counter WARNING:tensorflow:A checkpoint was restored (e.g. tf.train.Checkpoint.restore or tf.keras.Model.load_weights) but not all checkpointed values were used. See above for specific issues. Use expect_partial() on the load status object, e.g. tf.train.Checkpoint.restore(...).expect_partial(), to silence these warnings, or use assert_consumed() to make the check explicit.
W0916 07:32:58.886786 140440812377920 util.py:211] A checkpoint was restored (e.g. tf.train.Checkpoint.restore or tf.keras.Model.load_weights) but not all checkpointed values were used. See above for specific issues. Use expect_partial() on the load status object, e.g. tf.train.Checkpoint.restore(...).expect_partial(), to silence these warnings, or use assert_consumed() to make the check explicit. See tensorflow.org/guide/checkpoint#loading_mechanics for details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.