Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최강혁
/
dddd
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
yunjey
2017-01-22 18:03:21 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
249b708c10dbe579ea75f9d91b71f5fd903de41a
249b708c
1 parent
58fc5bd4
add code for creating directories
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
main.py
main.py
View file @
249b708
...
...
@@ -4,13 +4,21 @@ from solver import Solver
flags
=
tf
.
app
.
flags
flags
.
DEFINE_string
(
'mode'
,
'train'
,
"'pretrain', 'train' or 'eval'"
)
flags
.
DEFINE_string
(
'model_save_path'
,
'model'
,
"directory for saving the model"
)
flags
.
DEFINE_string
(
'sample_save_path'
,
'sample'
,
"directory for saving the sampled images"
)
FLAGS
=
flags
.
FLAGS
def
main
(
_
):
model
=
DTN
(
mode
=
FLAGS
.
mode
,
learning_rate
=
0.0003
)
solver
=
Solver
(
model
,
batch_size
=
100
,
pretrain_iter
=
5000
,
train_iter
=
2000
,
sample_iter
=
100
,
svhn_dir
=
'svhn'
,
mnist_dir
=
'mnist'
,
log_dir
=
'logs'
,
model_save_path
=
'model'
)
solver
=
Solver
(
model
,
batch_size
=
100
,
pretrain_iter
=
20000
,
train_iter
=
2000
,
sample_iter
=
100
,
svhn_dir
=
'svhn'
,
mnist_dir
=
'mnist'
,
model_save_path
=
FLAGS
.
model_save_path
,
sample_save_path
=
FLAGS
.
sample_save_path
)
# create directories if not exist
if
not
tf
.
gfile
.
Exists
(
FLAGS
.
model_save_path
):
tf
.
gfile
.
MakeDirs
(
FLAGS
.
model_save_path
)
if
not
tf
.
gfile
.
Exists
(
FLAGS
.
sample_save_path
):
tf
.
gfile
.
MakeDirs
(
FLAGS
.
sample_save_path
)
if
FLAGS
.
mode
==
'pretrain'
:
solver
.
pretrain
()
...
...
Please
register
or
login
to post a comment