Transfer model from TF2.8 to TF2.4


I have trained a model in TF2.8 that seems to be working quite well.
If i would like to convert it into a IR format in openvino i would need to use TF2.4 as its a requirement for openvino. When i try to use i´m getting strange errors that i through google think i can derive to my “jump” between versions.

This is the error i´m getting:

[ FRAMEWORK ERROR ] Cannot load input model: SavedModel format load failure: Shapes (1, 1, 128, 18) and (1, 1, 128, 546) are incompatible

I have been googleling this but without any real results, if anyone have ideas of how to fix this i would love some advice. The model was trained in TF2 2.7 (or 2.8) and i´m now trying to run it in TF2 2.4.

Would it be possible to somehow train a new model with the last checkpoint from my first model?
Would the new model benefit from this or is it safer/simpler to train a new “from scratch”?

Its a ssd_mobilenet_v1 model for object detection.



Hi Martin,

that depends if you’re using any new feature from TF > 2.4
I don’t know what can happen if you load a checkpoint from newer TF into an older version to continue training, again you might have the issue with new features not being available on older version

As a first test I’d try training from scratch on 2.4 just to make your conversion

That being said, the error you are getting doesn’t seem related to TF versioning but with different model signature. what’s the shape of the last layer of your model?