Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

fix: allow None as graph save_path setting. #181

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/anemoi/training/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,18 @@ def graph_data(self) -> HeteroData:

Creates the graph in all workers.
"""
graph_filename = Path(
self.config.hardware.paths.graph,
self.config.hardware.files.graph,
)
if self.config.hardware.files.graph is not None:
graph_filename = Path(
self.config.hardware.paths.graph,
self.config.hardware.files.graph,
)

if graph_filename.exists() and not self.config.graph.overwrite:
LOGGER.info("Loading graph data from %s", graph_filename)
return torch.load(graph_filename)

if graph_filename.exists() and not self.config.graph.overwrite:
LOGGER.info("Loading graph data from %s", graph_filename)
return torch.load(graph_filename)
else:
graph_filename = None

from anemoi.graphs.create import GraphCreator

Expand Down
Loading