dgl._ffi.base.DGLError when trying to load graphs

Hello,

I am getting the following error when trying to load the graphs.

Traceback (most recent call last):
  File "test.py", line 26, in <module>
    reactant_graphs = dgl.load_graphs(str(graph_data_dir) + '/val_graphs.bin')[0]
  File "/home/cheko/anaconda3/envs/graphein/lib/python3.8/site-packages/dgl/data/graph_serialize.py", line 182, in load_graphs
    return load_graph_v2(filename, idx_list)
  File "/home/cheko/anaconda3/envs/graphein/lib/python3.8/site-packages/dgl/data/graph_serialize.py", line 194, in load_graph_v2
    return [gdata.get_graph() for gdata in heterograph_list], label_dict
  File "/home/cheko/anaconda3/envs/graphein/lib/python3.8/site-packages/dgl/data/graph_serialize.py", line 194, in <listcomp>
    return [gdata.get_graph() for gdata in heterograph_list], label_dict
  File "/home/cheko/anaconda3/envs/graphein/lib/python3.8/site-packages/dgl/data/heterograph_serialize.py", line 59, in get_graph
    eframes.append(Frame(edict, num_rows=gidx.number_of_edges(etid)))
  File "/home/cheko/anaconda3/envs/graphein/lib/python3.8/site-packages/dgl/frame.py", line 494, in __init__
    raise DGLError('Expected all columns to have same # rows (%d), '
dgl._ffi.base.DGLError: Expected all columns to have same # rows (149), got 150 on 'b_factor'.

There was no error while creating the graphs so I’m a bit unsure of why this error is being thrown

This maybe difficult to debug. Could you verify the feature tensor shapes in your graph? For node features, their first dimension (i.e., the number of rows in the error message) must be equal to the number of nodes while for edge features, it must be equal to the number of edges.

@minjie Generating a different graph fixed this, so I am not keen on debugging it, but thanks for your help. Also, does dgl have any pre-trained models for protein structures?

does dgl have any pre-trained models for protein structures?

Not to my knowledge

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.