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
a2da829b
Commit
a2da829b
authored
Oct 11, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small change in regularizer log
parent
e220b436
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
tensorpack/models/regularize.py
tensorpack/models/regularize.py
+3
-2
tensorpack/train/multigpu.py
tensorpack/train/multigpu.py
+2
-1
No files found.
tensorpack/models/regularize.py
View file @
a2da829b
...
@@ -51,14 +51,15 @@ def regularize_cost(regex, func, name='regularize_cost'):
...
@@ -51,14 +51,15 @@ def regularize_cost(regex, func, name='regularize_cost'):
G
=
tf
.
get_default_graph
()
G
=
tf
.
get_default_graph
()
to_regularize
=
[]
to_regularize
=
[]
with
tf
.
name_scope
(
'regularize_cost'
):
with
tf
.
name_scope
(
'regularize_cost'
):
costs
=
[]
costs
=
[]
for
p
in
params
:
for
p
in
params
:
para_name
=
p
.
name
para_name
=
p
.
op
.
name
if
re
.
search
(
regex
,
para_name
):
if
re
.
search
(
regex
,
para_name
):
with
G
.
colocate_with
(
p
):
with
G
.
colocate_with
(
p
):
costs
.
append
(
func
(
p
))
costs
.
append
(
func
(
p
))
to_regularize
.
append
(
p
ara_
name
)
to_regularize
.
append
(
p
.
name
)
if
not
costs
:
if
not
costs
:
return
tf
.
constant
(
0
,
dtype
=
tf
.
float32
,
name
=
'empty_'
+
name
)
return
tf
.
constant
(
0
,
dtype
=
tf
.
float32
,
name
=
'empty_'
+
name
)
...
...
tensorpack/train/multigpu.py
View file @
a2da829b
...
@@ -323,7 +323,8 @@ class SyncMultiGPUTrainerReplicated(MultiGPUTrainerBase):
...
@@ -323,7 +323,8 @@ class SyncMultiGPUTrainerReplicated(MultiGPUTrainerBase):
if
prefix
in
realname
:
if
prefix
in
realname
:
logger
.
error
(
"[SyncMultiGPUTrainerReplicated] variable "
logger
.
error
(
"[SyncMultiGPUTrainerReplicated] variable "
"{} has its prefix {} appears multiple times in its name!"
.
format
(
v
.
name
,
prefix
))
"{} has its prefix {} appears multiple times in its name!"
.
format
(
v
.
name
,
prefix
))
copy_from
=
var_by_name
[
realname
]
copy_from
=
var_by_name
.
get
(
realname
)
assert
copy_from
is
not
None
,
var_by_name
.
keys
()
post_init_ops
.
append
(
v
.
assign
(
copy_from
.
read_value
()))
post_init_ops
.
append
(
v
.
assign
(
copy_from
.
read_value
()))
logger
.
info
(
logger
.
info
(
"'sync_variables_from_main_tower' includes {} operations."
.
format
(
len
(
post_init_ops
)))
"'sync_variables_from_main_tower' includes {} operations."
.
format
(
len
(
post_init_ops
)))
...
...
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