mp2893 / medgan

Generative adversarial network for generating electronic health records.
BSD 3-Clause "New" or "Revised" License
270 stars 90 forks source link

Restoring of trained model #2

Closed mlipkovich closed 7 years ago

mlipkovich commented 7 years ago

Thank you very much for the great paper and for providing the source code! I'm trying to train a very basic model which should generate a single binomial variable. After the training is done I'm getting the following error during data generation (after commenting 'train' part and uncommenting 'generate' part):

Tensor name "autoencoder/aee_b_0" not found in checkpoint files out_binomial/02_1_50000-999.index

I guess the reason is in these two lines https://github.com/mp2893/medgan/blob/e082e211e4273489c322a52316fef5c019aa9c17/medgan.py#L202 https://github.com/mp2893/medgan/blob/e082e211e4273489c322a52316fef5c019aa9c17/medgan.py#L206

There should be something like this instead: saver = tf.train.Saver() saver.restore(sess, tf.train.latest_checkpoint(modelDir)) sess.run(tf.global_variables_initializer())

But the problem is that with lines above there is no errors but generated data doesn't satisfy the same binomial distribution as original one so maybe it should be fixed in some other way?

Thank you!

mp2893 commented 7 years ago

Hi mliplovich,

Thanks for your interest in the work. I am assuming you are using "out_binomial/02_1_50000-999.index" as the argument to --model_file. Have you tried using "out_binomial/02_1_50000" or "out_binomial/02_1_50000-999" as the argument?

Thanks, Ed

mlipkovich commented 7 years ago

Hi Ed,

Thank you for quick response. You are right. It works now.

Thanks, Mikhail