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

save Bayesian Neural Network model using simple_save results in a HUGE file #919

Open
pswpswpsw opened this issue Aug 14, 2018 · 1 comment

Comments

@pswpswpsw
Copy link

pswpswpsw commented Aug 14, 2018

I use Tensorflow default save model API, it works. It can save and read model.

But simply for a two layer neural network with 8 hidden units costs me 68MB to save the model!

Just to report this issue. I don't get it why because the number of variable need to save is simply doubled for most cases in ADVI for mean-field approximation. My best guess is that the number of tensor operations by Edward are huge. So that since simple save saves everything.

In principle, if one save the model by manually collecting all the variable not operation, it should be fine.

update

When I use the manual save, I found the it is the .meta file that is to blame. So somehow, the graph created by Edward under the surface is becoming too much expensive for even saving a simple network.

@pswpswpsw
Copy link
Author

I figured this out.

The problem is after each epoch, I want to evaluate the performance by calling ed.evaluate

Everytime I call it, it might add new Node in to the graph, thus it causes the graph to become larger and larger.

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