Skip to content

Commit

Permalink
Remove env variable inside stargan
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre.delaunay committed Jun 6, 2024
1 parent 4334571 commit 420b2aa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
17 changes: 4 additions & 13 deletions benchmarks/stargan/stargan/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
import os
import argparse
from solver import Solver
Expand Down Expand Up @@ -197,29 +196,21 @@ def main(config):
parser.add_argument("--mode", type=str, default="train", choices=["train", "test"])
parser.add_argument("--use_tensorboard", type=str2bool, default=False)

# try:
# mbconfig = json.loads(os.environ["MILABENCH_CONFIG"])
# datadir = mbconfig["dirs"]["extra"]
# except:
# pass

datadir = "/tmp/milabench/cuda/results/data"

# Directories.
parser.add_argument("--celeba_image_dir", type=str, default="data/celeba/images")
parser.add_argument(
"--attr_path", type=str, default="data/celeba/list_attr_celeba.txt"
)
parser.add_argument("--rafd_image_dir", type=str, default="data/RaFD/train")
parser.add_argument("--log_dir", type=str, default=os.path.join(datadir, "logs"))
parser.add_argument("--log_dir", type=str, default="/data/logs")
parser.add_argument(
"--model_save_dir", type=str, default=os.path.join(datadir, "models")
"--model_save_dir", type=str, default="data/models"
)
parser.add_argument(
"--sample_dir", type=str, default=os.path.join(datadir, "samples")
"--sample_dir", type=str, default="data/samples"
)
parser.add_argument(
"--result_dir", type=str, default=os.path.join(datadir, "results")
"--result_dir", type=str, default="data/results"
)

# Step size.
Expand Down
6 changes: 5 additions & 1 deletion config/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,12 @@ stargan:
--image_size: 512
--c_dim: 5
--batch_size: 16
--dataset: "CelebA"
--dataset: "synth"
--celeba_image_dir: "{milabench_data}"
--log_dir: "{milabench_extra}/logs"
--model_save_dir: "{milabench_extra}/models"
--sample_dir: "{milabench_extra}/samples"
--result_dir: "{milabench_extra}/results"

super-slomo:
inherits: _defaults
Expand Down
6 changes: 3 additions & 3 deletions milabench/_version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""This file is generated, do not modify"""

__tag__ = "v0.0.6-126-g45b00ad"
__commit__ = "45b00adf57a249547ed737d59a509cd3734eb55e"
__date__ = "2024-06-06 13:55:11 -0400"
__tag__ = "v0.0.6-129-g4334571"
__commit__ = "433457173c9e040dc6772f06ee99110adc77ff71"
__date__ = "2024-06-06 16:03:46 -0400"
1 change: 1 addition & 0 deletions milabench/sizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ def resolve_argv(pack, argv):

context["milabench_data"] = pack.config.get("dirs", {}).get("data", None)
context["milabench_cache"] = pack.config.get("dirs", {}).get("cache", None)
context["milabench_extra"] = pack.config.get("dirs", {}).get("extra", None)

max_worker = 16
context["n_worker"] = min(context["cpu_per_gpu"], max_worker)
Expand Down

0 comments on commit 420b2aa

Please sign in to comment.