-
Notifications
You must be signed in to change notification settings - Fork 74k
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
Tensorflow: how to save/restore tf.data.Dataset? #15019
Comments
Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. |
I have a similar issue - Code with tf.Session(graph=tf.Graph()) as session:
graph_meta = tf.train.latest_checkpoint(model_dir) + '.meta'
saver = tf.train.import_meta_graph(os.path.join(model_dir, graph_meta))
saver.restore(session, tf.train.latest_checkpoint(model_dir))
feed_dict = {
'features:0': x_test # shape 102x13
}
predictions = session.run('logits:0', feed_dict)
print(predictions.shape) Error
|
@taehyunkim1527 Can you share a complete reproducible example of the problem? I was unable to reproduce the problem with the code fragment in your example, although it was possible to reproduce it by adding arguments to @suryasumukh I think you're running into a different problem. You certainly can feed values over the tensors returned from |
@mrry When i use that series of code of 'exporting and importing' in tensorflow/benchmarks's ImageNet tasks, I experienced this error message. |
Thanks for confirming that the problem doesn't arise with that exact code! I have a change in the pipeline that will make this path work in more cases (e.g. when using |
@mrry |
@suryasumukh In order to retrain the pre-trained model, the initializer of data iterator can be declared as a tf.operation with a name while training for the first time.
Then, it can be sess.run with the name and fed with training data. |
Not the point |
I made a model with
tf.data.Dataset()
as a data IO functionthen i exported the graph and tried to restore it with meta_graph file But it failed and following error messages occurred.
I think that
tf.data.Dataset()
made a C++ object instead of python queue used before.And the graph_def only has a C++ object handler reference, so the graph_def alone without real C++ object can't load complete graph.
How can I load a executable graph with
tf.data.Dataset()
? Or is it impossible for now?In short, all the tensorflow graphs without
tf.data.Dataset
work, when i add following codes.But the graphs with
tf.data.Dataset
make a error message aboveThe text was updated successfully, but these errors were encountered: