shenweichen / GraphEmbedding

Implementation and experiments of graph embedding algorithms.
MIT License
3.64k stars 990 forks source link

joblib backend问题 #5

Closed jinwangjoshua closed 2 years ago

jinwangjoshua commented 5 years ago

Preprocess transition probs... [Parallel(n_jobs=30)]: Using backend MultiprocessingBackend with 30 concurrent workers. multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/home/ubuntu/anaconda3/lib/python3.7/multiprocessing/pool.py", line 121, in worker result = (True, func(*args, *kwds)) File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/joblib/_parallel_backends.py", line 567, in call return self.func(args, **kwargs) File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 225, in call for func, args, kwargs in self.items] File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 225, in for func, args, kwargs in self.items] File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/ge/walker.py", line 88, in _simulate_walks walk_length=walk_length, start_node=v)) File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/ge/walker.py", line 56, in node2vec_walk next_node = cur_nbrs[alias_sample(alias_edges[edge][0], KeyError: (9836, 7324) """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "blog_node.py", line 69, in model = Node2Vec(G, 10, 80, workers=30,p=0.25,q=2 ) File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/ge/models/node2vec.py", line 39, in init num_walks=num_walks, walk_length=walk_length, workers=workers, verbose=1) File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/ge/walker.py", line 72, in simulate_walks partition_num(num_walks, workers)) File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 934, in call self.retrieve() File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/joblib/parallel.py", line 833, in retrieve self._output.extend(job.get(timeout=self.timeout)) File "/home/ubuntu/anaconda3/lib/python3.7/multiprocessing/pool.py", line 657, in get

我是下载之后把joblib的backend改成multiprocessing,但其实不管是默认的还是其他的,都会报错说keyerror是random一个数据点。我用的是http://socialcomputing.asu.edu/datasets/BlogCatalog3 这个数据集,不管是stru2vec还是node2vec都会遇到这样问题。请教

jinwangjoshua commented 5 years ago
  1. TypeError: unsupported operand type(s) for +: 'int' and 'str' 在stru2vec中会遇到gensim报这个问题(同样的数据),也请教一下
jlugjw commented 5 years ago
  1. TypeError: unsupported operand type(s) for +: 'int' and 'str' 在stru2vec中会遇到gensim报这个问题(同样的数据),也请教一下

那里有个print函数,把这个int值换成str()就行了eg:int i =5, print('值:'+str(i)) 话说key error这个,请问您解决了么,我也有这个问题。

roger40 commented 5 years ago

同样的问题,请问解决了吗

Magolor commented 4 years ago

KeyError问题+1,不过提示稍微有一点不同

radkoff commented 4 years ago

I was able to fix this, it was happening for non-directed graphs. Pull request here: https://github.com/shenweichen/GraphEmbedding/pull/40