Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
61b18977
Commit
61b18977
authored
Feb 27, 2018
by
Andrew M. Dai
Browse files
Fix some minor API issues.
parent
87fae3f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
research/maskgan/README.md
research/maskgan/README.md
+4
-3
research/maskgan/train_mask_gan.py
research/maskgan/train_mask_gan.py
+4
-4
No files found.
research/maskgan/README.md
View file @
61b18977
...
@@ -14,10 +14,11 @@ tested. Pretraining may not work correctly.
...
@@ -14,10 +14,11 @@ tested. Pretraining may not work correctly.
For training on PTB:
For training on PTB:
1.
(Optional) Pretrain a LM on PTB and store the checkpoint in /tmp/pretrain-lm/.
1.
(Optional) Pretrain a LM on PTB and store the checkpoint in
`
/tmp/pretrain-lm/
`
.
Instructions WIP.
Instructions WIP.
2.
(Optional) Run MaskGAN in MLE pretraining mode:
2.
(Optional) Run MaskGAN in MLE pretraining mode. If step 1 was not run, set
`language_model_ckpt_dir`
to empty.
```
bash
```
bash
python train_mask_gan.py
\
python train_mask_gan.py
\
...
@@ -39,7 +40,7 @@ python train_mask_gan.py \
...
@@ -39,7 +40,7 @@ python train_mask_gan.py \
--seq2seq_share_embedding
--seq2seq_share_embedding
```
```
3.
Run MaskGAN in GAN mode
:
3.
Run MaskGAN in GAN mode
. If step 2 was not run, set
`maskgan_ckpt`
to empty.
```
bash
```
bash
python train_mask_gan.py
\
python train_mask_gan.py
\
--data_dir
=
'/tmp/ptb'
\
--data_dir
=
'/tmp/ptb'
\
...
...
research/maskgan/train_mask_gan.py
View file @
61b18977
...
@@ -78,9 +78,9 @@ MODE_TEST = 'TEST'
...
@@ -78,9 +78,9 @@ MODE_TEST = 'TEST'
tf
.
app
.
flags
.
DEFINE_enum
(
tf
.
app
.
flags
.
DEFINE_enum
(
'mode'
,
'TRAIN'
,
[
MODE_TRAIN
,
MODE_VALIDATION
,
MODE_TEST
,
MODE_TRAIN_EVAL
],
'mode'
,
'TRAIN'
,
[
MODE_TRAIN
,
MODE_VALIDATION
,
MODE_TEST
,
MODE_TRAIN_EVAL
],
'What this binary will do.'
)
'What this binary will do.'
)
tf
.
app
.
flags
.
DEFINE_string
(
'master'
,
'
local
'
,
tf
.
app
.
flags
.
DEFINE_string
(
'master'
,
''
,
"""Name of the TensorFlow master to use."""
)
"""Name of the TensorFlow master to use."""
)
tf
.
app
.
flags
.
DEFINE_string
(
'eval_master'
,
'
local
'
,
tf
.
app
.
flags
.
DEFINE_string
(
'eval_master'
,
''
,
"""Name prefix of the Tensorflow eval master,
"""Name prefix of the Tensorflow eval master,
or "local"."""
)
or "local"."""
)
tf
.
app
.
flags
.
DEFINE_integer
(
'task'
,
0
,
tf
.
app
.
flags
.
DEFINE_integer
(
'task'
,
0
,
...
@@ -517,7 +517,7 @@ def train_model(hparams, data, log_dir, log, id_to_word, data_ngram_counts):
...
@@ -517,7 +517,7 @@ def train_model(hparams, data, log_dir, log, id_to_word, data_ngram_counts):
is_chief
=
FLAGS
.
task
==
0
is_chief
=
FLAGS
.
task
==
0
with
tf
.
Graph
().
as_default
():
with
tf
.
Graph
().
as_default
():
with
tf
.
device
(
tf
.
R
eplica
D
evice
S
etter
(
FLAGS
.
ps_tasks
)):
with
tf
.
device
(
tf
.
train
.
r
eplica
_d
evice
_s
etter
(
FLAGS
.
ps_tasks
)):
container_name
=
''
container_name
=
''
with
tf
.
container
(
container_name
):
with
tf
.
container
(
container_name
):
# Construct the model.
# Construct the model.
...
@@ -540,7 +540,7 @@ def train_model(hparams, data, log_dir, log, id_to_word, data_ngram_counts):
...
@@ -540,7 +540,7 @@ def train_model(hparams, data, log_dir, log, id_to_word, data_ngram_counts):
# Create the supervisor. It will take care of initialization,
# Create the supervisor. It will take care of initialization,
# summaries, checkpoints, and recovery.
# summaries, checkpoints, and recovery.
sv
=
tf
.
Supervisor
(
sv
=
tf
.
train
.
Supervisor
(
logdir
=
log_dir
,
logdir
=
log_dir
,
is_chief
=
is_chief
,
is_chief
=
is_chief
,
saver
=
model
.
saver
,
saver
=
model
.
saver
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment