markovmodel / deeptime

Deep learning meets molecular dynamics.
GNU Lesser General Public License v3.0
173 stars 39 forks source link

name K in not defined in notebook 1D_double_well #9

Closed cclementi closed 6 years ago

cclementi commented 6 years ago

Hi Andreas and Luca,

I am trying to use your notebook 1D_double_well, and it looks like the variable K that is used in the cell that performs the training is not defined. If the cell is run more than once, it attempts to clear the variable K but it can't find it. See below.

if 'model' in globals():
    del model
    K.clear_session()

# Build the model
Data_X = Input(shape = (input_size,))
Data_Y = Input(shape = (input_size,))
[...]
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-30-c75ab1430314> in <module>()
      1 if 'model' in globals():
      2     del model
----> 3     K.clear_session()
      4 
      5 # Build the model

NameError: name 'K' is not defined
pasqualil commented 6 years ago

Hi, the fix is to remove the use of variable K and just use the function 'clear_session()'. Fixing it right now