Skip to content

Commit

Permalink
Merge pull request #466 from nqhq-lou/dev_wandb
Browse files Browse the repository at this point in the history
Add Command-Line Argument for Specifying Wandb Directory
  • Loading branch information
ilyes319 authored Jun 21, 2024
2 parents 3e6eb77 + 9c259c2 commit ed0ff02
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions mace/cli/run_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ def run(args: argparse.Namespace) -> None:
entity=args.wandb_entity,
name=args.wandb_name,
config=wandb_config,
directory=args.wandb_dir,
)
wandb.run.summary["params"] = args_dict_json

Expand Down
6 changes: 6 additions & 0 deletions mace/tools/arg_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,12 @@ def build_default_arg_parser() -> argparse.ArgumentParser:
action="store_true",
default=False,
)
parser.add_argument(
"--wandb_dir",
help="An absolute path to a directory where Weights and Biases metadata will be stored",
type=str,
default=None,
)
parser.add_argument(
"--wandb_project",
help="Weights and Biases project name",
Expand Down
4 changes: 2 additions & 2 deletions mace/tools/torch_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ def voigt_to_matrix(t: torch.Tensor):
)


def init_wandb(project: str, entity: str, name: str, config: dict):
def init_wandb(project: str, entity: str, name: str, config: dict, directory:str):
import wandb

wandb.init(project=project, entity=entity, name=name, config=config)
wandb.init(project=project, entity=entity, name=name, config=config, dir=directory)


@contextmanager
Expand Down

0 comments on commit ed0ff02

Please sign in to comment.