-
Notifications
You must be signed in to change notification settings - Fork 74.2k
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
please share a total example from training in python and prediction in C++. #615
Comments
I tried to evaluate the graph file which is generated by tf.train.write_graph() in python, fed the required data, then run in session, finally encountered the followng error, the error shows use not initialized value. How to write the initialized value to file by tf.train.write_graph() ? W tensorflow/core/common_runtime/executor.cc:1076] 0x2672cc0 Compute status: Failed precondition: Attempting to use uninitialized value embedding/W |
same problem, please someone tell me how to restore weights from the checkpoint file via c++ |
This is probably a question better suited for stackoverflow. Short version: |
@martinwicke I run the loader.cc example and it's okay, After I load the graph and run the session with inputs I get following error:
And the number of variable is changing, 1, 2, 3,...
As the tutorial I wrote the graph and have the file, but in your previous comment you are saying that the write_graph only saves the architecture, but not the trained model, so:
|
Take a look at python/tools/freeze_graph.py, which takes the contents of On Sun, Feb 14, 2016 at 10:00 AM Hamed notifications@github.com wrote:
|
Thank you very much @martinwicke After looking into documentations, I found that there are few similar methods, can you tell what is the difference between Also one question about how to use Thank you! |
I think we should take this discussion to stackoverflow. Can you post there and add a link here? We shouldn't abuse the issue tracker for questions. I'll leave this issue open as a feature request for a tutorial on graph import/export. |
Yes, of course, here you are @martinwicke : http://stackoverflow.com/questions/35508866/tensorflow-different-ways-to-export-and-run-graph-in-c Btw, I want to inform you that the |
I think a new issue would be good, I don't think we have a fix for this yet. On Fri, Feb 19, 2016 at 7:30 AM Hamed notifications@github.com wrote:
|
👍
|
I've written a (hopefully) self-contained example today: http://stackoverflow.com/a/43639305/1076564 |
Hi @peci1, thanks for your helpful post on stackoverflow. However, I tried your solution but it complains
How you compile all necessary ops and kernels into the lib? |
@xumengwei Check out my other answer :) https://stackoverflow.com/a/43526252/1076564 . And I'm not sure if it still works with TF 1.4, I had some problems with it. But 1.3 is working for me. |
any recent(improved) methods to train models in Python and make predictions with C++? as now, what is the best method to achieve this? @martinwicke @HamedMP |
update nccl_manager_test.cc, Participant now takes nccl_stream
…8-onednn-v3 Enabling oneDNN v3.0 in QuantizedConv ops/fusions
Hi, TFs
Current I'm trying prediction in C++ following the tutorial in tensorflow/tensorflow/g3doc/tutorials/image_recognition/index.md.
I want to train the mode in python, using interface tf.train.write_graph() to write the graph to a file, and then loading it in the C++ for predition, just like the above tutorial. Because there is no python codes in the tutorial and no guides to create the file of "tensorflow_inception_graph.pb".
I've tried several times, but failed. Could you share a total example in both sides in pyhton and c++?
The text was updated successfully, but these errors were encountered: