-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathimage_main.py
More file actions
33 lines (26 loc) · 780 Bytes
/
image_main.py
File metadata and controls
33 lines (26 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# IMPORTS
import os
import hydra
from omegaconf import DictConfig, OmegaConf
from image_runner import Runner
import wandb
@hydra.main(config_path="conf", config_name="config_image")
def main(cfg: DictConfig):
# absolute path
cfg.data_dir = hydra.utils.to_absolute_path(cfg.data_dir)
# relative to hydra path
os.makedirs(cfg.model_dir, exist_ok=True)
os.makedirs(cfg.log_dir, exist_ok=True)
config_dict = OmegaConf.to_container(
cfg, resolve=True, throw_on_missing=True
)
wandb.init(project="", config=config_dict)
print(os.getcwd())
print(OmegaConf.to_yaml(cfg))
runner = Runner(cfg)
if cfg.mode == 'train':
runner.train()
else:
raise NotImplementedError
if __name__ == "__main__":
main()