{"action":"closed","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/16442","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/16442/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/16442/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/16442/events","html_url":"https://github.com/tensorflow/tensorflow/issues/16442","id":291805850,"number":16442,"title":"why save model and deploy in android device, the outputs are not the same as in ubuntu?","user":{"login":"leesino","id":7828435,"avatar_url":"https://avatars2.githubusercontent.com/u/7828435?v=4","gravatar_id":"","url":"https://api.github.com/users/leesino","html_url":"https://github.com/leesino","followers_url":"https://api.github.com/users/leesino/followers","following_url":"https://api.github.com/users/leesino/following{/other_user}","gists_url":"https://api.github.com/users/leesino/gists{/gist_id}","starred_url":"https://api.github.com/users/leesino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leesino/subscriptions","organizations_url":"https://api.github.com/users/leesino/orgs","repos_url":"https://api.github.com/users/leesino/repos","events_url":"https://api.github.com/users/leesino/events{/privacy}","received_events_url":"https://api.github.com/users/leesino/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"derekjchow","id":1195088,"avatar_url":"https://avatars2.githubusercontent.com/u/1195088?v=4","gravatar_id":"","url":"https://api.github.com/users/derekjchow","html_url":"https://github.com/derekjchow","followers_url":"https://api.github.com/users/derekjchow/followers","following_url":"https://api.github.com/users/derekjchow/following{/other_user}","gists_url":"https://api.github.com/users/derekjchow/gists{/gist_id}","starred_url":"https://api.github.com/users/derekjchow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekjchow/subscriptions","organizations_url":"https://api.github.com/users/derekjchow/orgs","repos_url":"https://api.github.com/users/derekjchow/repos","events_url":"https://api.github.com/users/derekjchow/events{/privacy}","received_events_url":"https://api.github.com/users/derekjchow/received_events","type":"User","site_admin":false},"assignees":[{"login":"derekjchow","id":1195088,"avatar_url":"https://avatars2.githubusercontent.com/u/1195088?v=4","gravatar_id":"","url":"https://api.github.com/users/derekjchow","html_url":"https://github.com/derekjchow","followers_url":"https://api.github.com/users/derekjchow/followers","following_url":"https://api.github.com/users/derekjchow/following{/other_user}","gists_url":"https://api.github.com/users/derekjchow/gists{/gist_id}","starred_url":"https://api.github.com/users/derekjchow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekjchow/subscriptions","organizations_url":"https://api.github.com/users/derekjchow/orgs","repos_url":"https://api.github.com/users/derekjchow/repos","events_url":"https://api.github.com/users/derekjchow/events{/privacy}","received_events_url":"https://api.github.com/users/derekjchow/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-01-26T05:50:11Z","updated_at":"2018-02-15T23:21:27Z","closed_at":"2018-02-15T23:21:27Z","author_association":"NONE","body":"OS Platform and Distribution :Ubuntu 14.04.5 LTS   && Android 8.0\r\nTensorFlow installed from source\r\nTensorFlow version :1..4.0\r\nPython version : 2.7.6\r\nBazel version :0.4.5\r\nGCC/Compiler version:4.8.4\r\nCUDA/cuDNN version:8.0\r\nGPU model and memory: GTX1080, 8G\r\nExact command to reproduce:\r\n\r\nstep 1. clone code from https://github.com/davidsandberg/facenet\r\nstep 2. in the file src/compare.py, add the follow code after line 90, after align.detect_face.create_mtcnn \r\n            output_node_names=['pnet/prob1','pnet/conv4-2/BiasAdd','pnet/conv1/BiasAdd','rnet/prob1','rnet/conv5-2/conv5-2','onet/prob1','onet/conv6-2/conv6-2','onet/conv6-3/conv6-3']\r\n            output_graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph.as_graph_def(), output_node_names) #sess.graph_def,\r\n            with tf.gfile.FastGFile(\"mtcnn.pb\", mode = 'wb') as f:\r\n                f.write(output_graph_def.SerializeToString())\r\n\r\nstep 3. run the command:  python src/compare.py ./data/20170512-110547 ./data/images/Anthony_Hopkins_0001.jpg ./data/images/Anthony_Hopkins_0002.jpg\r\nwill create the model file mtcnn.pb\r\n\r\nstep 4 deploy the file mtcnn.pb to android app, validate with the file Anthony_Hopkins_0001.jpg, indeed it can fetch the results for the outputs such as 'pnet/prob1','pnet/conv4-2/BiasAdd',  but the values are difference with the results from the facenet project run on ubuntu,\r\n\r\nthe query is what is the cause to the difference? the  way to create the mtcnn.pb is wrong? still need to optimize it to adapt android device? or there is something wrong with Tensorflow for mobile device?\r\n\r\nthe follow is the log show the difference:\r\nwith the same input:00.28515625,-0.24609375,-0.59765625\r\nbut the output is difference\r\n\r\nAndroid output\r\n \tLine 5555: 01-26 11:34:20.793 I/lxr     (22967): img00.28515625,-0.24609375,-0.59765625\r\n\tLine 5795: 01-26 11:34:21.326 I/lxr     (22967): mapWidth 70 mapHeight 70\r\n\tLine 5796: 01-26 11:34:21.327 I/lxr     (22967): outValue:0.9998832,1.16751995E-4\r\n\tLine 5797: 01-26 11:34:21.327 I/lxr     (22967): outReg:-0.068167016,-0.2052449,0.06884944,0.1512082\r\n\r\nUbuntu output\r\nimg_y (1, 150, 150, 3)\r\nimg_y0 [ 0.28515625 -0.24609375 -0.59765625]\r\nout0 shape (1, 70, 70, 4)\r\nout1 shape (1, 70, 70, 2)\r\nout0 [-0.07926445 -0.20101449  0.06468102  0.16017048]\r\nout1 [  9.99792397e-01   2.07666759e-04]\r\n"}}
{"actor":{"display_login":"drpngx"}}