LibRecommender
LibRecommender copied to clipboard
Error when running model.fit() a second time
When running the 'pure collaborative-filtering example' , it only works on the first run. When rerunning the code I get the error message 'ValueError: Variable bu_var already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at: ...'. Is there a simple fix for this problem? I need to rerun the algorithm a few times and can't open a new console every time. I am using python 3.8 and Tensorflow 2.3.
Just call tf.compat.v1.reset_default_graph()
before rerunning.
>>> svdpp = SVDpp(...)
>>> svdpp.fit(...)
>>> tf.reset_default_graph()
>>> svdpp = SVDpp(...)
>>> svdpp.fit(...)