Skip to content

Commit 80059a5

Browse files
BlaziusMaximuscopybara-github
authored andcommitted
Add proto_splitter info to tensorflow.org guide.
PiperOrigin-RevId: 555249702
1 parent 208bb04 commit 80059a5

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

site/en/guide/saved_model.ipynb

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,36 @@
723723
"imported_with_output_name.signatures['serving_default'].structured_outputs"
724724
]
725725
},
726+
{
727+
"cell_type": "markdown",
728+
"metadata": {
729+
"id": "Q4bCK55x1IBW"
730+
},
731+
"source": [
732+
"## Proto-splitting\n",
733+
"\n",
734+
"Due to limits of the protobuf implementation, proto sizes cannot exceed 2GB. This can lead to the following errors when attempting to save very large models:\n",
735+
"\n",
736+
"```\n",
737+
"ValueError: Message tensorflow.SavedModel exceeds maximum protobuf size of 2GB: ...\n",
738+
"```\n",
739+
"\n",
740+
"```\n",
741+
"google.protobuf.message.DecodeError: Error parsing message as the message exceeded the protobuf limit with type 'tensorflow.GraphDef'\n",
742+
"```\n",
743+
"\n",
744+
"If you wish to save models that exceed the 2GB limit, then you'll need to save using the new proto-splitting option:\n",
745+
"\n",
746+
"```python\n",
747+
"tf.saved_model.save(\n",
748+
" ...,\n",
749+
" options=tf.saved_model.SaveOptions(experimental_image_format=True)\n",
750+
")\n",
751+
"```\n",
752+
"\n",
753+
"More information can be found in the [Proto Splitter / Merger Library guide](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/proto_splitter/in-depth-guide.md)."
754+
]
755+
},
726756
{
727757
"cell_type": "markdown",
728758
"metadata": {
@@ -995,6 +1025,7 @@
9951025
"metadata": {
9961026
"colab": {
9971027
"name": "saved_model.ipynb",
1028+
"provenance": [],
9981029
"toc_visible": true
9991030
},
10001031
"kernelspec": {

0 commit comments

Comments
 (0)