Skip to content

Commit

Permalink
add wandb_dir in argparser, changed wandb directory related parts
Browse files Browse the repository at this point in the history
  • Loading branch information
Zekun Lou committed Jun 17, 2024
1 parent dee204f commit 912334d
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 @@ -676,6 +676,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 @@ -568,6 +568,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 912334d

Please sign in to comment.