Skip to content

Commit

Permalink
fix: zero graph raise err
Browse files Browse the repository at this point in the history
  • Loading branch information
YutackPark committed Oct 21, 2024
1 parent 99c5631 commit f55bd44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sevenn/train/graph_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def process(self):
data = self.pre_transform(data)
processed_graph_list.append(data)

if len(processed_graph_list) == 0:
# Can not save at all if there is no graph (error in PyG), raise an error
raise ValueError('Zero graph found after filtering')

# save graphs, handled by torch_geometrics
self.save(processed_graph_list, self.processed_paths[0])

Expand Down

0 comments on commit f55bd44

Please sign in to comment.