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

Script for loading the model #7

Closed
ALI7861111 opened this issue Mar 28, 2020 · 5 comments
Closed

Script for loading the model #7

ALI7861111 opened this issue Mar 28, 2020 · 5 comments

Comments

@ALI7861111
Copy link

is:issue Sir can you provide a simple code to load the model because i have tried many methods and all are showing some errors kindly also mention versions of tf. last error i got was :
{module 'tensorflow._api.v2.train' has no attribute 'import_meta_graph')
............... the code was as following :
import tensorflow as tf
new_graph = tf.Graph()
with tf.compat.v1.Session(graph=new_graph) as sess:
saver = tf.train.import_meta_graph('/content/models2/model.meta')
saver.restore(sess, "/content/models2/model")

i have also tried tf.compat.v1.Session and tf.Session but unable to load the model

@josephius
Copy link
Collaborator

You're actually quite close. Just change the following:

tf.train.import_meta_graph

To: tf.compat.v1.train.import_meta_graph

@lindawangg
Copy link
Owner

lindawangg commented Mar 29, 2020

We just released the evaluation script with the new model. Loading the model can be found in there.

@ALI7861111
Copy link
Author

thanks a lot

@ALI7861111
Copy link
Author

We just released the evaluation script with the new model. Loading the model can be found in there.

Can i get a script to like predict a single image the code is quite messy and no comments are made in it. Like i want to predict a single image on the model

@ALI7861111
Copy link
Author

is:issue Sir can you provide a simple code to load the model because i have tried many methods and all are showing some errors kindly also mention versions of tf. last error i got was :
{module 'tensorflow._api.v2.train' has no attribute 'import_meta_graph')
............... the code was as following :
import tensorflow as tf
new_graph = tf.Graph()
with tf.compat.v1.Session(graph=new_graph) as sess:
saver = tf.train.import_meta_graph('/content/models2/model.meta')
saver.restore(sess, "/content/models2/model")

i have also tried tf.compat.v1.Session and tf.Session but unable to load the model

Thanks that worked :)

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

3 participants