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
17a5bdc8
Unverified
Commit
17a5bdc8
authored
Feb 27, 2018
by
Lukasz Kaiser
Committed by
GitHub
Feb 27, 2018
Browse files
Merge pull request #3487 from a-dai/master
Fix some minor API issues.
parents
7d16fc45
9bbbeb44
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
research/maskgan/README.md
research/maskgan/README.md
+4
-3
research/maskgan/train_mask_gan.py
research/maskgan/train_mask_gan.py
+5
-6
No files found.
research/maskgan/README.md
View file @
17a5bdc8
...
...
@@ -14,10 +14,11 @@ tested. Pretraining may not work correctly.
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.
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
python train_mask_gan.py
\
...
...
@@ -39,7 +40,7 @@ python train_mask_gan.py \
--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
python train_mask_gan.py
\
--data_dir
=
'/tmp/ptb'
\
...
...
research/maskgan/train_mask_gan.py
View file @
17a5bdc8
...
...
@@ -78,11 +78,10 @@ MODE_TEST = 'TEST'
tf
.
app
.
flags
.
DEFINE_enum
(
'mode'
,
'TRAIN'
,
[
MODE_TRAIN
,
MODE_VALIDATION
,
MODE_TEST
,
MODE_TRAIN_EVAL
],
'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."""
)
tf
.
app
.
flags
.
DEFINE_string
(
'eval_master'
,
'local'
,
"""Name prefix of the Tensorflow eval master,
or "local"."""
)
tf
.
app
.
flags
.
DEFINE_string
(
'eval_master'
,
''
,
"""Name prefix of the Tensorflow eval master."""
)
tf
.
app
.
flags
.
DEFINE_integer
(
'task'
,
0
,
"""Task id of the replica running the training."""
)
tf
.
app
.
flags
.
DEFINE_integer
(
'ps_tasks'
,
0
,
"""Number of tasks in the ps job.
...
...
@@ -517,7 +516,7 @@ def train_model(hparams, data, log_dir, log, id_to_word, data_ngram_counts):
is_chief
=
FLAGS
.
task
==
0
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
=
''
with
tf
.
container
(
container_name
):
# Construct the model.
...
...
@@ -540,7 +539,7 @@ def train_model(hparams, data, log_dir, log, id_to_word, data_ngram_counts):
# Create the supervisor. It will take care of initialization,
# summaries, checkpoints, and recovery.
sv
=
tf
.
Supervisor
(
sv
=
tf
.
train
.
Supervisor
(
logdir
=
log_dir
,
is_chief
=
is_chief
,
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