GraphSAGE icon indicating copy to clipboard operation
GraphSAGE copied to clipboard

Save and load Model

Open harispervaiz opened this issue 4 years ago • 1 comments

Hello,

I have been saving my model via :

    save_path = saver.save(sess, model_path + model_name)
    print("Model saved in path: %s" % save_path)

But when it comes to restoring model :

saver = tf.compat.v1.train.Saver()

saver = tf.compat.v1.train.import_meta_graph(model_path + '/model.meta')
saver.restore(sess, tf.train.latest_checkpoint(model_path + '/'))

It restores but when i try to run it, it gives me following error:

Input to reshape is a tensor with 646076700 values, but the requested shape has 371140200

Help is much appreciated, maybe the way i am saving is wrong

Looking forward to hear back

harispervaiz avatar Jul 12 '21 10:07 harispervaiz

I have had this same problem and would be very curious to hear a resolution. The issue is the state graph and adjacent matrix are initialized to the original run, did you change anything such as batch size or max degree of sampled neighbors. This would affect it. Ultimately all placeholders and the adjacency matrix created in minibatch need to be identical, so maybe your problem setting would allow you to keep those attributes the same. Changing the structure of the graph being learned/inferred, however, is much more difficult. For reference see this post. Unfortunately, I have had no response but the post does link to other similar posts. original issue https://github.com/williamleif/GraphSAGE/issues/22

sam-lev avatar Jul 12 '21 17:07 sam-lev