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
1fae78e7
Commit
1fae78e7
authored
Sep 21, 2017
by
Olivia
Browse files
removing TF flags
parent
fa32bb5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
tutorials/image/cifar10/cifar10_eval.py
tutorials/image/cifar10/cifar10_eval.py
+14
-13
No files found.
tutorials/image/cifar10/cifar10_eval.py
View file @
1fae78e7
...
@@ -34,6 +34,7 @@ from __future__ import absolute_import
...
@@ -34,6 +34,7 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
argparse
from
datetime
import
datetime
from
datetime
import
datetime
import
math
import
math
import
time
import
time
...
@@ -43,20 +44,19 @@ import tensorflow as tf
...
@@ -43,20 +44,19 @@ import tensorflow as tf
import
cifar10
import
cifar10
FLAGS
=
tf
.
app
.
flags
.
FLAGS
parser
=
argparse
.
ArgumentParser
()
tf
.
app
.
flags
.
DEFINE_string
(
'eval_dir'
,
'/tmp/cifar10_eval'
,
parser
.
add_argument
(
'--eval_dir'
,
type
=
str
,
default
=
'/tmp/cifar10_eval'
,
help
=
'Directory where to write event logs.'
)
"""Directory where to write event logs."""
)
tf
.
app
.
flags
.
DEFINE_string
(
'eval_data'
,
'test'
,
parser
.
add_argument
(
'--eval_data'
,
type
=
str
,
default
=
'test'
,
help
=
'Either `test` or `train_eval`.'
)
"""Either 'test' or 'train_eval'."""
)
tf
.
app
.
flags
.
DEFINE_string
(
'checkpoint_dir'
,
'/tmp/cifar10_train'
,
parser
.
add_argument
(
'--checkpoint_dir'
,
type
=
str
,
default
=
'/tmp/cifar10_train'
,
help
=
'Directory where to read model checkpoints.'
)
"""Directory where to read model checkpoints."""
)
tf
.
app
.
flags
.
DEFINE_integer
(
'eval_interval_secs'
,
60
*
5
,
parser
.
add_argument
(
'--eval_interval_secs'
,
type
=
int
,
default
=
60
*
5
,
help
=
'How often to run the eval.'
)
"""How often to run the eval."""
)
tf
.
app
.
flags
.
DEFINE_integer
(
'num_examples'
,
10000
,
parser
.
add_argument
(
'--num_examples'
,
type
=
int
,
default
=
10000
,
help
=
'Number of examples to run.'
)
"""Number of examples to run."""
)
tf
.
app
.
flags
.
DEFINE_boolean
(
'run_once'
,
False
,
parser
.
add_argument
(
'--run_once'
,
type
=
bool
,
default
=
False
,
help
=
'Whether to run eval only once.'
)
"""Whether to run eval only once."""
)
def
eval_once
(
saver
,
summary_writer
,
top_k_op
,
summary_op
):
def
eval_once
(
saver
,
summary_writer
,
top_k_op
,
summary_op
):
...
@@ -154,4 +154,5 @@ def main(argv=None): # pylint: disable=unused-argument
...
@@ -154,4 +154,5 @@ def main(argv=None): # pylint: disable=unused-argument
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
FLAGS
=
parser
.
parse_args
()
tf
.
app
.
run
()
tf
.
app
.
run
()
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