{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/17540","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/17540/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/17540/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/17540/events","html_url":"https://github.com/tensorflow/tensorflow/issues/17540","id":303366821,"number":17540,"title":"Protobuf size explosion for TFLite","user":{"login":"nestle1993","id":18111038,"avatar_url":"https://avatars2.githubusercontent.com/u/18111038?v=4","gravatar_id":"","url":"https://api.github.com/users/nestle1993","html_url":"https://github.com/nestle1993","followers_url":"https://api.github.com/users/nestle1993/followers","following_url":"https://api.github.com/users/nestle1993/following{/other_user}","gists_url":"https://api.github.com/users/nestle1993/gists{/gist_id}","starred_url":"https://api.github.com/users/nestle1993/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nestle1993/subscriptions","organizations_url":"https://api.github.com/users/nestle1993/orgs","repos_url":"https://api.github.com/users/nestle1993/repos","events_url":"https://api.github.com/users/nestle1993/events{/privacy}","received_events_url":"https://api.github.com/users/nestle1993/received_events","type":"User","site_admin":false},"labels":[{"id":750616506,"url":"https://api.github.com/repos/tensorflow/tensorflow/labels/comp:lite","name":"comp:lite","color":"e99695","default":false}],"state":"open","locked":false,"assignee":{"login":"andrehentz","id":25754898,"avatar_url":"https://avatars3.githubusercontent.com/u/25754898?v=4","gravatar_id":"","url":"https://api.github.com/users/andrehentz","html_url":"https://github.com/andrehentz","followers_url":"https://api.github.com/users/andrehentz/followers","following_url":"https://api.github.com/users/andrehentz/following{/other_user}","gists_url":"https://api.github.com/users/andrehentz/gists{/gist_id}","starred_url":"https://api.github.com/users/andrehentz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrehentz/subscriptions","organizations_url":"https://api.github.com/users/andrehentz/orgs","repos_url":"https://api.github.com/users/andrehentz/repos","events_url":"https://api.github.com/users/andrehentz/events{/privacy}","received_events_url":"https://api.github.com/users/andrehentz/received_events","type":"User","site_admin":false},"assignees":[{"login":"andrehentz","id":25754898,"avatar_url":"https://avatars3.githubusercontent.com/u/25754898?v=4","gravatar_id":"","url":"https://api.github.com/users/andrehentz","html_url":"https://github.com/andrehentz","followers_url":"https://api.github.com/users/andrehentz/followers","following_url":"https://api.github.com/users/andrehentz/following{/other_user}","gists_url":"https://api.github.com/users/andrehentz/gists{/gist_id}","starred_url":"https://api.github.com/users/andrehentz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrehentz/subscriptions","organizations_url":"https://api.github.com/users/andrehentz/orgs","repos_url":"https://api.github.com/users/andrehentz/repos","events_url":"https://api.github.com/users/andrehentz/events{/privacy}","received_events_url":"https://api.github.com/users/andrehentz/received_events","type":"User","site_admin":false}],"milestone":null,"comments":10,"created_at":"2018-03-08T06:04:56Z","updated_at":"2018-05-27T03:01:16Z","closed_at":null,"author_association":"NONE","body":"### System information\r\n- **Have I written custom code (as opposed to using a stock example script provided in TensorFlow)**: No\r\n- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Ubuntu 16.04.3 LTS\r\n- **TensorFlow installed from (source or binary)**: binary\r\n- **TensorFlow version (use command below)**: tf 1.6.0\r\n- **Python version**: Python 3.5.2\r\n- **Bazel version (if compiling from source)**: bazel release 0.7.0\r\n- **GCC/Compiler version (if compiling from source)**: gcc 4.9.4\r\n- **CUDA/cuDNN version**: /\r\n- **GPU model and memory**: /\r\n- **Exact command to reproduce**: \r\n`bazel run --config=opt tensorflow/contrib/lite/toco:toco -- --input_file=/tmp/gru_rnn.pb --input_format=TENSORFLOW_GRAPHDEF  --input_types=FLOAT --output_format=TFLITE --output_file=/tmp/gru_rnn.tflite --inference_type=FLOAT --inference_input_type=FLOAT --output_arrays=model/softmax,model/rnn_states`\r\n\r\n\r\n### Describe the problem\r\nI successfully built a tflite model for mobile usage on November, 2017, and the size of .tflite was almost the same as .pb (no quantized), which was bout 950k.\r\n\r\nHowever, when I try to convert the same .pb to tflite model with tensorflow 1.6 master branch (HEAD commit f7acdf2ed5e0b9c50c1c5f4b80163255aa9e8073), I find that the size of the .tflite file is 17M, **which is 17x larger than before!!**\r\n\r\nSo I make a binary search of the commits in `tensorflow/contrib/lite` history, then I find out at which commit that thing changes: the commit 90ce80131a8b5213d9f3eb9649d63921db7874a4 can produce 950k .tflite model, but right after it 528d0c5e4d148655b797368fd55fe6304730fece will make the tflite model become 17M.\r\n\r\nHere are some additional information:\r\n  - Both of these two tflite models can be successfully run on mobile.\r\n  - I did not check the commits (if there have) between these two, since I only trace the `/tensorflow/contrib/lite` history.\r\n  - I guess the problem happened due to some of the operations I used in my frozen graph, in which I have 2 layer gru and some linear transforms. But I cannot upload the .pb file here..."},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/392301749","html_url":"https://github.com/tensorflow/tensorflow/issues/17540#issuecomment-392301749","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/17540","id":392301749,"user":{"login":"tensorflowbutler","id":28546240,"avatar_url":"https://avatars2.githubusercontent.com/u/28546240?v=4","gravatar_id":"","url":"https://api.github.com/users/tensorflowbutler","html_url":"https://github.com/tensorflowbutler","followers_url":"https://api.github.com/users/tensorflowbutler/followers","following_url":"https://api.github.com/users/tensorflowbutler/following{/other_user}","gists_url":"https://api.github.com/users/tensorflowbutler/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflowbutler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflowbutler/subscriptions","organizations_url":"https://api.github.com/users/tensorflowbutler/orgs","repos_url":"https://api.github.com/users/tensorflowbutler/repos","events_url":"https://api.github.com/users/tensorflowbutler/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflowbutler/received_events","type":"User","site_admin":false},"created_at":"2018-05-27T03:01:16Z","updated_at":"2018-05-27T03:01:16Z","author_association":"MEMBER","body":"Nagging Assignee @andrehentz: It has been 23 days with no activity and this issue has an assignee. Please update the label and/or status accordingly."}}
{"actor":{"display_login":"tensorflowbutler"}}