Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Command-Line Argument for Specifying Wandb Directory #466

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
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
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