PacktPublishing / Graph-Machine-Learning

Graph Machine Learning, published by Packt
MIT License
261 stars 140 forks source link

Chapter 3 Source Code Issue #4

Closed raelpty closed 2 years ago

raelpty commented 3 years ago

I tried to run the code "01_Shallow_Embeddings.ipynb" unfortunately when I try to run this excerpt : from gem.embedding.gf import GraphFactorization

G = nx.barbell_graph(m1=10, m2=4) draw_graph(G)

gf = GraphFactorization(d=2, data_set=None,max_iter=10000, eta=1*10**-4, regu=1.0) gf.learn_embedding(G)

I have the following error : ./gf not found. Reverting to Python implementation. Please compile gf, place node2vec in the path and grant executable permission Iter id: 0, Objective: 95.0097, f1: 95.0035, f2: 0.00623775

The error is located specifically with this instruction: gf.learn_embedding(G)

amarzullo24 commented 2 years ago

Dear @raelpty, That is not exactly an error: the GEM library is warning you that it is not able to find the C++ executable. Therefore the Python implementation will be used. This means that you can still compute the embeddings, just slower.

If you want GEM using the C++ implementation you should compile it, as reported on the original GEM repository

Notice that, once compiled, the executable gf needs to be put in the c_exe directory (which is where the learn_embedding method will look for it). Eventually, be sure to properly configure the system path and give rights to the executable.

zf-wei commented 1 year ago

hi emmeduz. I put the complied gf file in the c_exe folder and give it x permission. But it is still not found. What should I do?

deeptisingh113 commented 5 months ago

I also got the same issue, even after compiling the gf file.