libspn-keras icon indicating copy to clipboard operation
libspn-keras copied to clipboard

Error when saving RAT-SPN

Open twebr opened this issue 3 years ago • 2 comments

I run into an issue when trying to save the RAT-SPN from the examples (https://git.io/JGLRe). It seems distinct from the earlier issue (#9) on this topic.

When saving, I get the AttributeError: 'PermuteAndPadScopesRandom' object has no attribute 'num_vars_spn_input'.

I think the issue can be solved by removing the reference to attribute num_vars_spn_input on line 117 of permute_and_pad_scopes_random.py. But I am not sure if it can be removed safely.

twebr avatar May 27 '21 11:05 twebr

Thanks for reporting this! I will look into it and see if I can implement some testing around this too. For the time being, I'd suggest you simply store the weights of the SPN using save_weights and load them again using load_weights. You will need to have some piece of code that constructs the same SPN in terms of layers for both the save-script as well as the load-script. Hope that makes sense.

jostosh avatar May 27 '21 18:05 jostosh

Thank you, that will do as a workaround!

twebr avatar May 31 '21 09:05 twebr