A problem on the code of HAN

When running main.py --hetero:

Created directory results\ACMRaw_2020-03-19_22-25-11
Traceback (most recent call last):
File “F:/Python/HAN_torch/main.py”, line 97, in
main(args)
File “F:/Python/HAN_torch/main.py”, line 62, in main
logits = model(g, features)
File “C:\Users\HP\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py”, line 532, in call
result = self.forward(*input, **kwargs)
File “F:\Python\HAN_torch\model_hetero.py”, line 97, in forward
h = gnn(g, h)
File “C:\Users\HP\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py”, line 532, in call
result = self.forward(*input, **kwargs)
File “F:\Python\HAN_torch\model_hetero.py”, line 79, in forward
semantic_embeddings.append(self.gat_layers[i](new_g, h).flatten(1))
File “C:\Users\HP\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py”, line 532, in call
result = self.forward(*input, **kwargs)
File “C:\Users\HP\AppData\Local\Programs\Python\Python37\lib\site-packages\dgl\nn\pytorch\conv\gatconv.py”, line 111, in forward
graph.edata[‘a’] = self.attn_drop(edge_softmax(graph, e))
File “C:\Users\HP\AppData\Local\Programs\Python\Python37\lib\site-packages\dgl\nn\pytorch\softmax.py”, line 179, in edge_softmax
return EdgeSoftmax.apply(graph, logits, eids)
File “C:\Users\HP\AppData\Local\Programs\Python\Python37\lib\site-packages\dgl\nn\pytorch\softmax.py”, line 52, in forward
gidx = g._graph.get_immutable_gidx(utils.to_dgl_context(score.device))
File “C:\Users\HP\AppData\Local\Programs\Python\Python37\lib\site-packages\dgl_ffi_ctypes\object.py”, line 61, in getattr
“’%s’ object has no attribute ‘%s’” % (str(type(self)), name))
AttributeError: ‘<class ‘dgl.heterograph_index.HeteroGraphIndex’>’ object has no attribute ‘get_immutable_gidx’

This is a duplicate of issue #1277 and should be fixed with the latest version. Could you please try installing the nightly-built version as suggested in our README?

1 Like