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

Cant find training operation. Trying to use this to train a old keras model in C #102

Open
Eths33 opened this issue Dec 10, 2019 · 0 comments

Comments

@Eths33
Copy link

Eths33 commented Dec 10, 2019

Trying to find the key graph operations, and I am not finding an easy way to find the training operation.

I added the following code to your python script from https://gist.github.com/asimshankar/7c9f8a9b04323e93bb217109da8c7ad2#file-train-c

In the code below train_op came right from the declaration of tensorflow operations. I am trying to find a way to get the training operation name from my keras model. Any ideas?

# tf.train.Saver.__init__ adds operations to the graph to save
    # and restore variables.
    saver_def = tf.train.Saver().as_saver_def()

    #print('Run this operation to initialize variables     : ', init.name)
    #print('Run this operation for a train step            : ', train_op.name)
    print('Feed this tensor to set the checkpoint filename: ', saver_def.filename_tensor_name)
    print('Run this operation to save a checkpoint        : ', saver_def.save_tensor_name)
    print('Run this operation to restore a checkpoint     : ', saver_def.restore_op_name)

    tf.train.write_graph(tf.get_default_graph(),  str(output_fld), 'graph.pb', as_text=False)

    # Readable but not correct for using with the example tensorflow C
    tf.train.write_graph(tf.get_default_graph(),  str(output_fld), 'graphText.pb', as_text=True) 
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

1 participant