Skip to content

index out of bound

Trying to run train_model.py, there are problems. Possible cause, the dataset is empty?

Trace:

 python python/train_model.py
Processing...
Preprocessing files in dataset_subgraph_1_31_n100_k10.
Processing dataset_subgraph_1_31_n100_k10:  |                                | 0/0
Traceback (most recent call last):
  File "/Users/josephleroux/Work/mcnf_gcn/python/train_model.py", line 42, in <module>
    train_dataset = load_dataset(train_data_path, bias_threshold)
  File "/Users/josephleroux/Work/mcnf_gcn/python/dataset.py", line 224, in load_dataset
    dataset = GraphDataset(dataset_name, processed_data_root, dataset_path, bias_threshold,
  File "/Users/josephleroux/Work/mcnf_gcn/python/dataset.py", line 151, in __init__
    super(GraphDataset, self).__init__(root, transform, pre_transform, pre_filter)
  File "/Users/josephleroux/Work/mcnf_gcn/mcnfvenv/lib/python3.10/site-packages/torch_geometric/data/in_memory_dataset.py", line 55, in __init__
    super().__init__(root, transform, pre_transform, pre_filter, log)
  File "/Users/josephleroux/Work/mcnf_gcn/mcnfvenv/lib/python3.10/site-packages/torch_geometric/data/dataset.py", line 94, in __init__
    self._process()
  File "/Users/josephleroux/Work/mcnf_gcn/mcnfvenv/lib/python3.10/site-packages/torch_geometric/data/dataset.py", line 211, in _process
    self.process()
  File "/Users/josephleroux/Work/mcnf_gcn/python/dataset.py", line 185, in process
    data, slices = self.collate(data_list)
  File "/Users/josephleroux/Work/mcnf_gcn/mcnfvenv/lib/python3.10/site-packages/torch_geometric/data/in_memory_dataset.py", line 104, in collate
    data_list[0].__class__,
IndexError: list index out of range