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
58fc1dea
Commit
58fc1dea
authored
Sep 30, 2020
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
1b98fe58
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
tensorpack/callbacks/prof.py
tensorpack/callbacks/prof.py
+1
-1
tensorpack/tfutils/varreplace.py
tensorpack/tfutils/varreplace.py
+10
-1
No files found.
tensorpack/callbacks/prof.py
View file @
58fc1dea
...
...
@@ -146,12 +146,12 @@ class GPUUtilizationTracker(Callback):
if
evt
.
is_set
():
# stop epoch
if
stop_evt
.
is_set
():
# or on exit
return
evt
.
clear
()
if
cnt
>
1
:
# Ignore the last datapoint. Usually is zero, makes us underestimate the util.
stats
-=
data
cnt
-=
1
rst_queue
.
put
(
stats
/
cnt
)
evt
.
clear
()
break
except
Exception
:
logger
.
exception
(
"Exception in GPUUtilizationTracker.worker"
)
...
...
tensorpack/tfutils/varreplace.py
View file @
58fc1dea
...
...
@@ -4,6 +4,7 @@
from
contextlib
import
contextmanager
from
..utils
import
logger
from
..compat
import
tfv1
as
tf
from
.common
import
get_tf_version_tuple
...
...
@@ -113,7 +114,15 @@ def freeze_variables(stop_gradient=True, skip_collection=False):
# do not perform unnecessary changes if it's not originally trainable
# otherwise the variable may get added to MODEL_VARIABLES twice
if
trainable
and
skip_collection
:
tf
.
add_to_collection
(
tf
.
GraphKeys
.
MODEL_VARIABLES
,
v
)
if
isinstance
(
v
,
tf
.
Variable
):
tf
.
add_to_collection
(
tf
.
GraphKeys
.
MODEL_VARIABLES
,
v
)
else
:
logger
.
warning
(
"""
[freeze_variables] variable getter did not return a Variable, but '{}' instead, likely due to
another custom getter. freeze_variables() work only if the other custom getter respects the
`trainable` argument and don't put variables with `trainable=False` into TRAINABLE_VARIABLES
collection. Please double check if this is true for the custom getter.
"""
.
format
(
str
(
v
))
.
replace
(
"
\n
"
,
""
))
if
trainable
and
stop_gradient
:
v
=
tf
.
stop_gradient
(
v
,
name
=
'freezed_'
+
name
)
return
v
...
...
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