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
bfad96d7
Commit
bfad96d7
authored
Oct 28, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into model-redesign
parents
8f8ae315
d38d22bf
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
23 additions
and
16 deletions
+23
-16
.github/ISSUE_TEMPLATE.md
.github/ISSUE_TEMPLATE.md
+5
-1
examples/FasterRCNN/README.md
examples/FasterRCNN/README.md
+2
-2
examples/FasterRCNN/data.py
examples/FasterRCNN/data.py
+3
-3
examples/FasterRCNN/train.py
examples/FasterRCNN/train.py
+5
-5
tensorpack/callbacks/monitor.py
tensorpack/callbacks/monitor.py
+2
-1
tensorpack/models/regularize.py
tensorpack/models/regularize.py
+1
-0
tensorpack/predict/base.py
tensorpack/predict/base.py
+2
-1
tensorpack/tfutils/summary.py
tensorpack/tfutils/summary.py
+3
-3
No files found.
.github/ISSUE_TEMPLATE.md
View file @
bfad96d7
...
...
@@ -2,7 +2,11 @@ Bug Reports/Feature Requests/Usage Questions Only:
Bug Reports (including performance bug):
Some part of code (either the library or examples) doesn't work as expected.
Always include what you did, what you observed, what you expected.
Always include the following:
1.
What you did. (command you run if using examples; post or describe your code if not)
2.
What you observed. (training logs)
3.
What you expected, if not obvious
4.
Your environment (TF version, GPUs), if it matters.
Feature Requests:
1.
Improve an existing feature.
...
...
examples/FasterRCNN/README.md
View file @
bfad96d7
...
...
@@ -39,8 +39,8 @@ To predict on an image (and show output in a window):
## Results
+
trainval35k/minival, FASTRCNN_BATCH=256: 3
2.9
+
trainval35k/minival, FASTRCNN_BATCH=64: 3
1.6. Takes less than one day on 8 Maxwell
TitanX.
+
trainval35k/minival, FASTRCNN_BATCH=256: 3
3.4. Takes 49h on 8 TitanX.
+
trainval35k/minival, FASTRCNN_BATCH=64: 3
2.2. Takes 31h on 8
TitanX.
The hyperparameters are not carefully tuned. You can probably get better performance by e.g. training longer.
...
...
examples/FasterRCNN/data.py
View file @
bfad96d7
...
...
@@ -191,9 +191,9 @@ def get_rpn_anchor_input(im, boxes, klass, is_crowd):
def
read_and_augment_images
(
ds
):
def
mapf
(
dp
):
fname
=
dp
[
0
]
im
=
cv2
.
imread
(
fname
,
cv2
.
IMREAD_COLOR
)
.
astype
(
'float32'
)
assert
im
is
not
None
,
dp
[
0
]
dp
[
0
]
=
im
im
=
cv2
.
imread
(
fname
,
cv2
.
IMREAD_COLOR
)
assert
im
is
not
None
,
fname
dp
[
0
]
=
im
.
astype
(
'float32'
)
# assume floatbox as input
assert
dp
[
1
]
.
dtype
==
np
.
float32
...
...
examples/FasterRCNN/train.py
View file @
bfad96d7
...
...
@@ -288,19 +288,19 @@ if __name__ == '__main__':
# linear warmup
ScheduledHyperParamSetter
(
'learning_rate'
,
[(
0
,
0.003
),
(
warmup_epoch
*
factor
,
0.01
)],
interp
=
'linear'
),
[(
0
,
3e-3
),
(
warmup_epoch
*
factor
,
1e-2
)],
interp
=
'linear'
),
# step decay
ScheduledHyperParamSetter
(
'learning_rate'
,
[(
warmup_epoch
*
factor
,
0.01
),
(
1
2
0000
*
factor
//
stepnum
,
1e-3
),
(
18
0000
*
factor
//
stepnum
,
1e-4
)]),
[(
warmup_epoch
*
factor
,
1e-2
),
(
1
5
0000
*
factor
//
stepnum
,
1e-3
),
(
21
0000
*
factor
//
stepnum
,
1e-4
)]),
HumanHyperParamSetter
(
'learning_rate'
),
EvalCallback
(),
GPUUtilizationTracker
(),
],
steps_per_epoch
=
stepnum
,
max_epoch
=
2
05
000
*
factor
//
stepnum
,
max_epoch
=
2
30
000
*
factor
//
stepnum
,
session_init
=
get_model_loader
(
args
.
load
)
if
args
.
load
else
None
,
)
trainer
=
SyncMultiGPUTrainerReplicated
(
get_nr_gpu
())
...
...
tensorpack/callbacks/monitor.py
View file @
bfad96d7
...
...
@@ -130,7 +130,8 @@ class Monitors(Callback):
if
val
.
WhichOneof
(
'value'
)
==
'simple_value'
:
val
.
tag
=
re
.
sub
(
'tower[0-9]+/'
,
''
,
val
.
tag
)
# TODO move to subclasses
# TODO This hack not needed any more, can remove this in the future
# TODO This hack is still needed, seem to disappear only when
# compiled from source.
suffix
=
'-summary'
# tensorflow#6150, tensorboard#59
if
val
.
tag
.
endswith
(
suffix
):
val
.
tag
=
val
.
tag
[:
-
len
(
suffix
)]
...
...
tensorpack/models/regularize.py
View file @
bfad96d7
...
...
@@ -41,6 +41,7 @@ def regularize_cost(regex, func, name='regularize_cost'):
cost = cost + regularize_cost("fc.*/W", l2_regularizer(1e-5))
"""
assert
len
(
regex
)
ctx
=
get_current_tower_context
()
if
not
ctx
.
is_training
:
# Currently cannot build the wd_cost correctly at inference,
...
...
tensorpack/predict/base.py
View file @
bfad96d7
...
...
@@ -163,7 +163,8 @@ class OfflinePredictor(OnlinePredictor):
input_tensors
=
get_tensors_by_names
(
config
.
input_names
)
output_tensors
=
get_tensors_by_names
(
config
.
output_names
)
config
.
session_init
.
_setup_graph
()
sess
=
config
.
session_creator
.
create_session
()
config
.
session_init
.
init
(
sess
)
config
.
session_init
.
_run_
init
(
sess
)
super
(
OfflinePredictor
,
self
)
.
__init__
(
input_tensors
,
output_tensors
,
config
.
return_input
,
sess
)
tensorpack/tfutils/summary.py
View file @
bfad96d7
...
...
@@ -119,8 +119,8 @@ def add_tensor_summary(x, types, name=None, collections=None,
return
SUMMARY_TYPES_DIC
=
{
'scalar'
:
lambda
:
tf
.
summary
.
scalar
(
name
,
x
,
collections
=
collections
),
'histogram'
:
lambda
:
tf
.
summary
.
histogram
(
name
,
x
,
collections
=
collections
),
'scalar'
:
lambda
:
tf
.
summary
.
scalar
(
name
+
'-summary'
,
x
,
collections
=
collections
),
'histogram'
:
lambda
:
tf
.
summary
.
histogram
(
name
+
'-histogram'
,
x
,
collections
=
collections
),
'sparsity'
:
lambda
:
tf
.
summary
.
scalar
(
name
+
'-sparsity'
,
tf
.
nn
.
zero_fraction
(
x
),
collections
=
collections
),
...
...
@@ -246,7 +246,7 @@ def add_moving_summary(*args, **kwargs):
ema_ops
.
append
(
ema_op
)
with
tf
.
name_scope
(
None
):
# cannot add it into colocate group -- will force everything to cpus
tf
.
summary
.
scalar
(
name
,
ema_op
)
# write the EMA value as a summary
tf
.
summary
.
scalar
(
name
+
'-summary'
,
ema_op
)
# write the EMA value as a summary
if
coll
is
not
None
:
for
op
in
ema_ops
:
# TODO a new collection to summary every step?
...
...
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