Skip to content

SDNE implementation error #94

@isikcakmak

Description

@isikcakmak

Dear authors,
I have issues using your implementation of sdne algorithm.
when I run "!pip install git+https://github.com/palash1992/GEM.git, I get this ERROR: textgenrnn 1.4.1 has requirement keras>=2.1.5, but you'll have keras 2.0.2 which is incompatible.

I am using keras version 2.3.0-tf,tensorflow version=2.2.0-rc3,networkx=2.4
I tried to upgrade to the previous version of tensorflow.
I tried "from tensorflow.python.keras import backend as k"

When I run embedding/sdne.py I get error:
Using TensorFlow backend.
Num nodes: 34, num edges: 77

AttributeError Traceback (most recent call last)
in ()
36 t1 = time()
37 # Learn embedding - accepts a networkx graph or file with edge list
---> 38 Y, t = embedding.learn_embedding(graph=G, edge_f=None, is_weighted=True, no_python=True)
39 print (embedding._method_name+':\n\tTraining time: %f' % (time() - t1))
40 # Evaluate on graph reconstruction

4 frames
/usr/local/lib/python3.6/dist-packages/gem/embedding/sdne.py in learn_embedding(self, graph, edge_f, is_weighted, no_python)
89 self._K, self._n_units,
90 self._nu1, self._nu2,
---> 91 self._actfn)
92 self._decoder = get_decoder(self._node_num, self._d,
93 self._K, self._n_units,

/usr/local/lib/python3.6/dist-packages/gem/embedding/sdne_utils.py in get_encoder(node_num, d, K, n_units, nu1, nu2, activation_fn)
63 def get_encoder(node_num, d, K, n_units, nu1, nu2, activation_fn):
64 # Input
---> 65 x = Input(shape=(node_num,))
66 # Encoder layers
67 y = [None] * (K + 1)

/usr/local/lib/python3.6/dist-packages/keras/engine/topology.py in Input(shape, batch_shape, name, dtype, sparse, tensor)
1386 name=name, dtype=dtype,
1387 sparse=sparse,
-> 1388 input_tensor=tensor)
1389 # Return tensor including _keras_shape and _keras_history.
1390 # Note that in this case train_output and test_output are the same pointer.

/usr/local/lib/python3.6/dist-packages/keras/engine/topology.py in init(self, input_shape, batch_size, batch_input_shape, dtype, input_tensor, sparse, name)
1251 if not name:
1252 prefix = 'input'
-> 1253 name = prefix + '_' + str(K.get_uid(prefix))
1254 super(InputLayer, self).init(dtype=dtype, name=name)
1255

/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py in get_uid(prefix)
45 def get_uid(prefix=''):
46 global _GRAPH_UID_DICTS
---> 47 graph = tf.get_default_graph()
48 if graph not in _GRAPH_UID_DICTS:
49 _GRAPH_UID_DICTS[graph] = defaultdict(int)

AttributeError: module 'tensorflow' has no attribute 'get_default_graph'

Best regards,
ışık

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions