forked from lmnt-com/diffwave
-
Notifications
You must be signed in to change notification settings - Fork 0
/
training_script.py
51 lines (34 loc) · 1.17 KB
/
training_script.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import os
# Print current dir
import argparse
# When running parallel jobs, we can for some reason run into issues if
# the processes are not started from within the main scope
def do_training():
data_dir = "wavs11025"
log_dir = "log_11025"
model_dir = "model_11025"
training_args = {
"model_dir": model_dir,
"data_dirs": [data_dir],
"log_dir": log_dir,
"max_steps": None,
"fp16": False,
"wandb_log": False,
"project_name": "diffwave_gpu_1.0",
}
# os.system(f"python -m diffwave.preprocess {directory}")
# os.system(f"python -m diffwave model_11025 {directory}")
args = argparse.Namespace(**training_args)
if not os.path.exists(data_dir):
print(f"Can't find data directory at {data_dir}, make sure it exists and is being mounted correctly")
return
# Check if directory exists
if not os.path.exists(log_dir):
os.makedirs(log_dir)
if not os.path.exists(model_dir):
os.makedirs(model_dir)
from diffwave.learner import train
from diffwave.params import params
train(args, params)
if __name__ == "__main__":
do_training()