probability icon indicating copy to clipboard operation
probability copied to clipboard

Saving models with DenseVariational layers

Open wbeardall opened this issue 6 years ago • 3 comments

Currently, models utilising DenseVariational fail to save (in my experience), because of them lacking a get_config method. Is there any timeline on when this might be implemented?

wbeardall avatar Feb 20 '20 13:02 wbeardall

I'm also experiencing this problem, is there a solution found already?

bram-wiggers-viacon avatar Dec 17 '20 10:12 bram-wiggers-viacon

I am facing the same problem, and I think the problem is the weights names. When I use one DenseVariational layer and print out the weight names, I get a duplicated entry (3 and 4):

0 lstm/lstm_cell/kernel:0
1 lstm/lstm_cell/recurrent_kernel:0
2 lstm/lstm_cell/bias:0
3 dense_variational/constant:0
4 dense_variational/constant:0

Saving weights_only yields:

RuntimeError: Unable to create link (name already exists)

And full model saving yields the get_config error:

NotImplementedError: Layer DenseVariational has arguments in `__init__` and therefore must override `get_config`.

nils-fl avatar Mar 10 '21 08:03 nils-fl

I think we can circumvent this problem by using the save_weights method.

KazukiOhta avatar Jan 10 '22 07:01 KazukiOhta