Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
b48cd060
Commit
b48cd060
authored
May 29, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use global_step utilities from TF
parent
461d20cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
10 deletions
+4
-10
tensorpack/tfutils/common.py
tensorpack/tfutils/common.py
+4
-7
tensorpack/utils/naming.py
tensorpack/utils/naming.py
+0
-3
No files found.
tensorpack/tfutils/common.py
View file @
b48cd060
...
@@ -4,11 +4,10 @@
...
@@ -4,11 +4,10 @@
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
import
tensorflow
as
tf
import
tensorflow
as
tf
from
tensorflow.python.training
import
training_util
from
six.moves
import
map
from
six.moves
import
map
from
..utils.argtools
import
graph_memoized
from
..utils.argtools
import
graph_memoized
from
..utils.naming
import
GLOBAL_STEP_OP_NAME
__all__
=
[
'get_default_sess_config'
,
__all__
=
[
'get_default_sess_config'
,
'get_global_step_value'
,
'get_global_step_value'
,
'get_global_step_var'
,
'get_global_step_var'
,
...
@@ -58,11 +57,9 @@ def get_global_step_var():
...
@@ -58,11 +57,9 @@ def get_global_step_var():
scope
=
tf
.
get_variable_scope
()
scope
=
tf
.
get_variable_scope
()
assert
scope
.
name
==
''
,
\
assert
scope
.
name
==
''
,
\
"The global_step variable should be created under the root variable scope!"
"The global_step variable should be created under the root variable scope!"
with
tf
.
variable_scope
(
scope
,
reuse
=
False
),
\
assert
not
scope
.
reuse
,
\
tf
.
name_scope
(
None
):
"The global_step variable shouldn't be called under a reuse variable scope!"
var
=
tf
.
get_variable
(
GLOBAL_STEP_OP_NAME
,
var
=
training_util
.
get_or_create_global_step
()
initializer
=
tf
.
constant
(
0
,
dtype
=
tf
.
int64
),
trainable
=
False
,
dtype
=
tf
.
int64
)
return
var
return
var
...
...
tensorpack/utils/naming.py
View file @
b48cd060
...
@@ -3,9 +3,6 @@
...
@@ -3,9 +3,6 @@
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
import
tensorflow
as
tf
import
tensorflow
as
tf
# this is also the name used by tf.train.get_global_step
GLOBAL_STEP_OP_NAME
=
'global_step'
GLOBAL_STEP_VAR_NAME
=
'global_step:0'
GLOBAL_STEP_INCR_OP_NAME
=
'global_step_incr'
GLOBAL_STEP_INCR_OP_NAME
=
'global_step_incr'
GLOBAL_STEP_INCR_VAR_NAME
=
'global_step_incr:0'
GLOBAL_STEP_INCR_VAR_NAME
=
'global_step_incr:0'
...
...
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