Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
distiller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
distiller
Commits
bd57f8ad
Commit
bd57f8ad
authored
4 years ago
by
Neta Zmora
Browse files
Options
Downloads
Patches
Plain Diff
Improve error message when using ActivationAPoZRankedFilterPruner
See issue #444
parent
fcb1ad90
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
distiller/pruning/ranked_structures_pruner.py
+10
-6
10 additions, 6 deletions
distiller/pruning/ranked_structures_pruner.py
with
10 additions
and
6 deletions
distiller/pruning/ranked_structures_pruner.py
+
10
−
6
View file @
bd57f8ad
...
...
@@ -342,14 +342,18 @@ class ActivationRankedFilterPruner(_RankedStructureParameterPruner):
# Use the parameter name to locate the module that has the activation sparsity statistics
fq_name
=
param_name
.
replace
(
"
.conv
"
,
"
.relu
"
)[:
-
len
(
"
.weight
"
)]
#
distiller.assign_layer_fq_names(model)
distiller
.
assign_layer_fq_names
(
model
)
module
=
distiller
.
find_module_by_fq_name
(
model
,
fq_name
)
if
module
is
None
:
raise
ValueError
(
"
Could not find a layer named %s in the model.
"
"
\n
Make sure to use assign_layer_fq_names()
"
%
fq_name
)
assert
module
is
not
None
if
not
hasattr
(
module
,
self
.
activation_rank_criterion
):
raise
ValueError
(
"
Could not find attribute
\"
%s
\"
in module %s
"
"
\n
Make sure to use SummaryActivationStatsCollector(
\"
%s
\"
)
"
%
raise
ValueError
(
"
Could not find attribute
\"
%s
\"
in module %s
\n
"
"
\t
This is pruner uses activation statistics collected during forward-
"
"
passes of the network.
\n
"
"
\t
This error is an indication that these statistics
"
"
have not been collected yet.
\n
"
"
\t
Make sure to use SummaryActivationStatsCollector(
\"
%s
\"
)
\n
"
"
\t
For more info see issue #444 (https://github.com/NervanaSystems/distiller/issues/444)
"
%
(
self
.
activation_rank_criterion
,
fq_name
,
self
.
activation_rank_criterion
))
quality_criterion
,
std
=
getattr
(
module
,
self
.
activation_rank_criterion
).
value
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment