Impact of distribution strategy on keras SavedModel variables size on disk

Skip to first unread message

Jason Brancazio

Mar 11, 2022, 1:34:22 AMMar 11
to Discuss
Hi Tensorflow-discuss,

When I save a tf.keras model compiled with a MirroredStrategy on a Vertex AI workbench instance with 4 T4 GPUs attached, the resulting SavedModel variables are 3x the size on disk (1.3GB) of a model compiled on the same instance with the default strategy and then saved (430MB).

If I reload the 1.3GB saved model with the default strategy, then resave it, the variables remain at 1.3GB, instead of shrinking to 430MB.

I don't even have to train the compiled model to see these differences.

I've read the guides and tutorials about model saving and loading, and I'm still struggling to understand why this happens. Can anyone shed some light? Is this known behavior?

Sayak Paul

Mar 11, 2022, 1:40:19 AMMar 11
to Jason Brancazio, Discuss
Hi Jason,

This mailist is quite inactive. I would suggest posting this on This issue seems to be an important one to address.

Sayak Paul |

You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages