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
ba2758b3
Commit
ba2758b3
authored
May 05, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove get_variable_on_tower. fix #243
parent
3e9de2ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
19 deletions
+1
-19
tensorpack/libinfo.py
tensorpack/libinfo.py
+1
-1
tensorpack/tfutils/tower.py
tensorpack/tfutils/tower.py
+0
-18
No files found.
tensorpack/libinfo.py
View file @
ba2758b3
# issue#1924 may happen on old systems
# issue#1924 may happen on old systems
import
cv2
# noqa
import
cv2
# noqa
import
os
# issue#7378 may happen with custom opencv. It doesn't hurt to disable opencl
# issue#7378 may happen with custom opencv. It doesn't hurt to disable opencl
import
os
os
.
environ
[
'OPENCV_OPENCL_RUNTIME'
]
=
''
os
.
environ
[
'OPENCV_OPENCL_RUNTIME'
]
=
''
os
.
environ
[
'TF_ENABLE_WINOGRAD_NONFUSED'
]
=
'1'
# issue#9339
os
.
environ
[
'TF_ENABLE_WINOGRAD_NONFUSED'
]
=
'1'
# issue#9339
...
...
tensorpack/tfutils/tower.py
View file @
ba2758b3
...
@@ -48,24 +48,6 @@ class TowerContext(object):
...
@@ -48,24 +48,6 @@ class TowerContext(object):
return
0
return
0
return
int
(
self
.
_name
[
-
1
])
return
int
(
self
.
_name
[
-
1
])
def
get_variable_on_tower
(
self
,
*
args
,
**
kwargs
):
"""
Get a variable for this tower specifically, without reusing, even if
it is called under a ``reuse=True`` variable scope.
Tensorflow doesn't allow us to disable reuse under a
``reuse=True`` scope. This method provides a work around.
See https://www.tensorflow.org/versions/master/how_tos/variable_scope/index.html#basics-of-tfvariable-scope
Args:
args: same as ``tf.get_variable()``.
"""
with
tf
.
variable_scope
(
self
.
_name
)
as
scope
:
with
tf
.
variable_scope
(
scope
,
reuse
=
False
):
scope
=
tf
.
get_variable_scope
()
assert
not
scope
.
reuse
return
tf
.
get_variable
(
*
args
,
**
kwargs
)
def
find_tensor_in_main_tower
(
self
,
graph
,
name
):
def
find_tensor_in_main_tower
(
self
,
graph
,
name
):
if
self
.
is_main_tower
:
if
self
.
is_main_tower
:
return
graph
.
get_tensor_by_name
(
name
)
return
graph
.
get_tensor_by_name
(
name
)
...
...
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