Update 2 files
Browse files- /wandb.py
- /trainer.cli.py
- trainer.cli.py +5 -3
- wandb.py +5 -3
trainer.cli.py
CHANGED
|
@@ -6,6 +6,8 @@ from argparse import ArgumentParser
|
|
| 6 |
|
| 7 |
from util import ConfigParser
|
| 8 |
|
|
|
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
parser = ArgumentParser(
|
|
@@ -23,6 +25,6 @@ if __name__ == '__main__':
|
|
| 23 |
|
| 24 |
config = ConfigParser(args.config_path).config
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
print(
|
|
|
|
| 6 |
|
| 7 |
from util import ConfigParser
|
| 8 |
|
| 9 |
+
from wandb import Wandb
|
| 10 |
+
|
| 11 |
|
| 12 |
|
| 13 |
parser = ArgumentParser(
|
|
|
|
| 25 |
|
| 26 |
config = ConfigParser(args.config_path).config
|
| 27 |
|
| 28 |
+
|
| 29 |
+
wandb = Wandb(config)
|
| 30 |
+
print(wandb.name)
|
wandb.py
CHANGED
|
@@ -7,11 +7,13 @@ from util import Config, RandomCode
|
|
| 7 |
|
| 8 |
class Wandb:
|
| 9 |
def __init__(self, config: Config):
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
raise ValueError('Missing required values for either Entity, Project or API Key')
|
| 12 |
|
| 13 |
-
if
|
| 14 |
-
|
| 15 |
|
| 16 |
os.environ['WANDB_API_KEY'] = api_key
|
| 17 |
wandb.init(project, entity, name)
|
|
|
|
| 7 |
|
| 8 |
class Wandb:
|
| 9 |
def __init__(self, config: Config):
|
| 10 |
+
self.__dict__ = config.__dict__
|
| 11 |
+
|
| 12 |
+
if entity is None or project is None or api_key is None:
|
| 13 |
raise ValueError('Missing required values for either Entity, Project or API Key')
|
| 14 |
|
| 15 |
+
if name == '':
|
| 16 |
+
name = 'run-' + RandomCode()
|
| 17 |
|
| 18 |
os.environ['WANDB_API_KEY'] = api_key
|
| 19 |
wandb.init(project, entity, name)
|