forked from anc2001/SP-GAN
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtrain.py
More file actions
32 lines (26 loc) · 739 Bytes
/
train.py
File metadata and controls
32 lines (26 loc) · 739 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
#!/usr/bin/env python
#-*- coding:utf-8 _*-
"""
@author:liruihui
@file: train.py
@time: 2019/09/17
@contact: ruihuili.lee@gmail.com
@github: https://liruihui.github.io/
@description:
"""
import os
import pprint
pp = pprint.PrettyPrinter()
from datetime import datetime
from Generation.model import Model
from Generation.config import opts
if __name__ == '__main__':
if opts.phase == "train":
current_time = datetime.now().strftime("%Y%m%d-%H%M")
opts.log_dir = os.path.join(opts.log_dir,current_time)
if not os.path.exists(opts.log_dir):
os.makedirs(opts.log_dir)
#opts.log_dir = "log/20210124-0059"
print('checkpoints:', opts.log_dir)
model = Model(opts)
model.train()