Skip to content
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

Open
YCG09 opened this issue Jul 14, 2017 · 1 comment
Open

How to restore a model for android #33

YCG09 opened this issue Jul 14, 2017 · 1 comment

Comments

@YCG09
Copy link

YCG09 commented Jul 14, 2017

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!

@ucasiggcas
Copy link

几百M的模型能加载进去吗???手机不会黑屏、闪退?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants