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
e2be301b
Commit
e2be301b
authored
Jul 27, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix import
parent
e0e29779
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
examples/ResNet/imagenet_resnet_utils.py
examples/ResNet/imagenet_resnet_utils.py
+8
-3
No files found.
examples/ResNet/imagenet_resnet_utils.py
View file @
e2be301b
...
...
@@ -8,9 +8,14 @@ import tensorflow as tf
from
tensorflow.contrib.layers
import
variance_scaling_initializer
import
tensorpack
as
tp
from
tensorpack
import
imgaug
from
tensorpack.tfutils
import
argscope
from
tensorpack.models
import
*
from
tensorpack.tfutils.summary
import
add_moving_summary
from
tensorpack.models
import
(
Conv2D
,
MaxPooling
,
GlobalAvgPooling
,
BatchNorm
,
BNReLU
,
LinearWrap
)
from
tensorpack.predict
import
PredictConfig
,
SimpleDatasetPredictor
class
GoogleNetResize
(
imgaug
.
ImageAugmentor
):
...
...
@@ -137,12 +142,12 @@ def resnet_backbone(image, num_blocks, block_func):
def
eval_on_ILSVRC12
(
model
,
model_file
,
dataflow
):
pred_config
=
PredictConfig
(
model
=
model
,
session_init
=
get_model_loader
(
model_file
),
session_init
=
tp
.
get_model_loader
(
model_file
),
input_names
=
[
'input'
,
'label'
],
output_names
=
[
'wrong-top1'
,
'wrong-top5'
]
)
pred
=
SimpleDatasetPredictor
(
pred_config
,
dataflow
)
acc1
,
acc5
=
RatioCounter
(),
RatioCounter
()
acc1
,
acc5
=
tp
.
RatioCounter
(),
tp
.
RatioCounter
()
for
o
in
pred
.
get_result
():
batch_size
=
o
[
0
]
.
shape
[
0
]
acc1
.
feed
(
o
[
0
]
.
sum
(),
batch_size
)
...
...
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