-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to restore a model for android #33
Comments
几百M的模型能加载进去吗???手机不会黑屏、闪退? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
Thanks for your excellent work.
I want to restore a pb model to support for android like this:
output_graph_def = graph_util.convert_variables_to_constants(session, session.graph_def,output_node_names=['output'])
with tf.gfile.FastGFile('model/model.pb', mode='wb') as f:
f.write(output_graph_def.SerializeToString())
Moreover, I have to get the name of input tensor and output like this:
private static final String inputName = "input";
private static final String outputName = "output";
TensorFlowInferenceInterface inferenceInterface;
inferenceInterface.feed(inputName, inputs, WIDTH, HEIGHT);
inferenceInterface.fetch(outputName, outputs);
But I couldn't find the input tensor name, is the line below the place I should modify? I am not sure..
images, labels, _ = distorted_inputs(FLAGS.train_dir, FLAGS.batch_size, FLAGS.image_size, FLAGS.num_preprocess_threads)
Would you please give me some advice? Thank you!
The text was updated successfully, but these errors were encountered: