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
eb560e61
Commit
eb560e61
authored
May 29, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bump travis version, fix lint
parent
d6c2d6b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
.travis.yml
.travis.yml
+2
-2
examples/Saliency/CAM-resnet.py
examples/Saliency/CAM-resnet.py
+4
-2
No files found.
.travis.yml
View file @
eb560e61
...
@@ -20,10 +20,10 @@ matrix:
...
@@ -20,10 +20,10 @@ matrix:
include
:
include
:
-
os
:
linux
-
os
:
linux
python
:
2.7
python
:
2.7
env
:
TF_VERSION=1.
1.0
TF_TYPE=release
env
:
TF_VERSION=1.
2.0rc1
TF_TYPE=release
-
os
:
linux
-
os
:
linux
python
:
3.5
python
:
3.5
env
:
TF_VERSION=1.
1.0
TF_TYPE=release
env
:
TF_VERSION=1.
2.0rc1
TF_TYPE=release
-
os
:
linux
-
os
:
linux
python
:
2.7
python
:
2.7
env
:
TF_VERSION=1.head TF_TYPE=nightly
env
:
TF_VERSION=1.head TF_TYPE=nightly
...
...
examples/Saliency/CAM-resnet.py
View file @
eb560e61
...
@@ -123,8 +123,9 @@ class Model(ModelDesc):
...
@@ -123,8 +123,9 @@ class Model(ModelDesc):
[(
'conv0.*'
,
0.1
),
(
'group[0-2].*'
,
0.1
)])]
[(
'conv0.*'
,
0.1
),
(
'group[0-2].*'
,
0.1
)])]
return
optimizer
.
apply_grad_processors
(
opt
,
gradprocs
)
return
optimizer
.
apply_grad_processors
(
opt
,
gradprocs
)
# completely copied from imagenet-resnet.py example
def
get_data
(
train_or_test
):
def
get_data
(
train_or_test
):
# completely copied from imagenet-resnet.py example
isTrain
=
train_or_test
==
'train'
isTrain
=
train_or_test
==
'train'
datadir
=
args
.
data
datadir
=
args
.
data
...
@@ -224,7 +225,7 @@ def viz_cam(model_file, data_dir):
...
@@ -224,7 +225,7 @@ def viz_cam(model_file, data_dir):
if
wrongs
[
i
]:
if
wrongs
[
i
]:
continue
continue
weight
=
W
[:,
[
labels
[
i
]]]
.
T
# 512x1
weight
=
W
[:,
[
labels
[
i
]]]
.
T
# 512x1
convmap
=
convmaps
[
i
,
:,:,:]
# 512xhxw
convmap
=
convmaps
[
i
,
:,
:,
:]
# 512xhxw
mergedmap
=
np
.
matmul
(
weight
,
convmap
.
reshape
((
512
,
-
1
)))
.
reshape
(
14
,
14
)
mergedmap
=
np
.
matmul
(
weight
,
convmap
.
reshape
((
512
,
-
1
)))
.
reshape
(
14
,
14
)
mergedmap
=
cv2
.
resize
(
mergedmap
,
(
224
,
224
))
mergedmap
=
cv2
.
resize
(
mergedmap
,
(
224
,
224
))
heatmap
=
viz
.
intensity_to_rgb
(
mergedmap
,
normalize
=
True
)
heatmap
=
viz
.
intensity_to_rgb
(
mergedmap
,
normalize
=
True
)
...
@@ -237,6 +238,7 @@ def viz_cam(model_file, data_dir):
...
@@ -237,6 +238,7 @@ def viz_cam(model_file, data_dir):
if
cnt
==
500
:
if
cnt
==
500
:
return
return
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
parser
=
argparse
.
ArgumentParser
()
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'--gpu'
,
help
=
'comma separated list of GPU(s) to use.'
,
required
=
True
)
parser
.
add_argument
(
'--gpu'
,
help
=
'comma separated list of GPU(s) to use.'
,
required
=
True
)
...
...
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