Hello. I want to load data from my CSV file to do Graph Classification. In the example, ‘feat’ column is written like “0.736833152378035,0.10522806046048205,0.9418796835016118”. My data’s nodes, edges and graph’s features are float. So I just made them as str and add them by ‘+’ and put it in ‘feat’ column. Is it right? I’m doubting this.
I made meta.yaml, nodes.csv, edges.csv, graphs.csv files in same folder but when i try to load data, after some minutes, Keyerror happend. Here is the rough error code.(I’m making the code in another internal-network computer so I can’t copy and paste it)
KeyError Traceback (most recent call last)
—> dataset = dgl.data.CSVDataset(’./GC’)
in CSVDataset.init()
→ super().init(
ds_name,
raw_dir=os.path.dirname(meta_yaml_path),
force_reload=force_reload,
verbose=verbose,
transfrom=transform,
)
in DGLDataset.init()
else:
self._save_dir = save_dir
—> self._load()
in DGLDataset.__load(self)
if not load_flag:
self._download()
—> self.process()
self.save()
if self.verbose:
in CSVDataset.process(self)
graph_data = GraphData.load_from_csv(
meta_graph,
base_dir=base_dir,
separator=meta_yaml.seperator,
data_parser=data_parser,
)
#construct graph
—> self.graphs, self.data = DGLGraphConstructor.construct_graphs(
node_data, edge_data, graph_data
)
if len(self.data) == 1:
self.labels = list(self.data.values())[0]
in DGLGraphConstructor.construct_graphs(node_data, edge_data, graph_data)
edge_data = [edge_data]
node_dict = Nodedata.to_dict(node_data)
—> edge_dict = EdgeData.to_dict(edge_data, node_dict)
graph_dict = DGLGraphConstructor._construct_graphs(node_dict, edge_Dict)
if graph_data is None:
in EdgeData.to_dict(edge_data, node_dict)
orig_src_ids = e_data.src[idx].astype(
node_dict[graph_id][src_type]['dtype]
)
orig_dst_ids = e_data.src[idx].astype(
node_dict[graph_id][dst_type]['dtype]
)
—> src_ids = [src_mapping[index] for index in orig_src_ids]
dst_ids = [src_mapping[index] for index in orig_dst_ids]
if graph_id not in edge_dict:
in (.0)
orig_src_ids = e_data.src[idx].astype(
none_dict[graph_id][src_type][‘dtype’]
)
orig_dst_ids = e_data.src[idx].astype(
none_dict[graph_id][dst_type][‘dtype’]
)
—> src_ids = [src_mapping[index] for index in orig_src_ids]
dst_ids = [src_mapping[index] for index in orig_dst_ids]
if graph_id not in edge_dict:
KeyError : 975083
I’m wondering why this error happened, and how to fix it.
I checked whole nodes and graphs’s id are in ‘node_id’ and ‘graph_id’, no duplicated.
I would really appreciate it if you could reply my question.
Thank you.