hkrds1996 / SDEC

4 stars 3 forks source link

Error when following instructions #1

Open abhijeetchauhan opened 4 years ago

abhijeetchauhan commented 4 years ago

TypeError: add_weight() got multiple values for argument 'name'

hkrds1996 commented 4 years ago

Did you use Keras v2.0? I think it's the problem of your Keras' version that makes this error.

lazzyCloud commented 3 years ago

TypeError: add_weight() got multiple values for argument 'name'

change line 144: self.clusters = self.add_weight(shape=(self.n_clusters, input_dim), initializer='glorot_uniform', name='clusters')

You may also need:

import tensorflow as tf

import tensorflow.compat.v1 as tf tf.disable_v2_behavior()

These allow you to run the script under the latest Keras & tensorflow, with python2.

If you want to run it with python3, change:

However, I would like to suggest owner to add a requirements.txt file to specify all packages they used, and some comments on how to adjust the code to python3, since python2 retired...