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
7877a7f7
Commit
7877a7f7
authored
Jul 12, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update docs
parent
c712e8dd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
9 deletions
+22
-9
.github/ISSUE_TEMPLATE.md
.github/ISSUE_TEMPLATE.md
+1
-0
examples/FasterRCNN/coco.py
examples/FasterRCNN/coco.py
+1
-3
examples/FasterRCNN/config.py
examples/FasterRCNN/config.py
+1
-1
examples/FasterRCNN/train.py
examples/FasterRCNN/train.py
+0
-1
examples/ImageNetModels/imagenet_utils.py
examples/ImageNetModels/imagenet_utils.py
+1
-1
tensorpack/input_source/input_source.py
tensorpack/input_source/input_source.py
+8
-1
tensorpack/train/trainers.py
tensorpack/train/trainers.py
+10
-2
No files found.
.github/ISSUE_TEMPLATE.md
View file @
7877a7f7
...
@@ -19,6 +19,7 @@ For any unexpected problems, __PLEASE ALWAYS INCLUDE__:
...
@@ -19,6 +19,7 @@ For any unexpected problems, __PLEASE ALWAYS INCLUDE__:
+
TF version:
`python -c 'import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)'`
.
+
TF version:
`python -c 'import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)'`
.
+
Tensorpack version:
`python -c 'import tensorpack; print(tensorpack.__version__)'`
.
+
Tensorpack version:
`python -c 'import tensorpack; print(tensorpack.__version__)'`
.
You can install Tensorpack master by
`pip install -U git+https://github.com/ppwwyyxx/tensorpack.git`
.:
You can install Tensorpack master by
`pip install -U git+https://github.com/ppwwyyxx/tensorpack.git`
.:
+
Hardware information, if relevant.
5.
About efficiency, PLEASE first read http://tensorpack.readthedocs.io/en/latest/tutorial/performance-tuning.html
5.
About efficiency, PLEASE first read http://tensorpack.readthedocs.io/en/latest/tutorial/performance-tuning.html
Feature Requests:
Feature Requests:
...
...
examples/FasterRCNN/coco.py
View file @
7877a7f7
...
@@ -18,8 +18,6 @@ from config import config as cfg
...
@@ -18,8 +18,6 @@ from config import config as cfg
__all__
=
[
'COCODetection'
,
'COCOMeta'
]
__all__
=
[
'COCODetection'
,
'COCOMeta'
]
COCO_NUM_CATEGORY
=
80
class
_COCOMeta
(
object
):
class
_COCOMeta
(
object
):
INSTANCE_TO_BASEDIR
=
{
INSTANCE_TO_BASEDIR
=
{
...
@@ -39,7 +37,7 @@ class _COCOMeta(object):
...
@@ -39,7 +37,7 @@ class _COCOMeta(object):
cat_names: list of names
cat_names: list of names
"""
"""
assert
not
self
.
valid
()
assert
not
self
.
valid
()
assert
len
(
cat_ids
)
==
COCO_NUM_CATEGORY
and
len
(
cat_names
)
==
COCO_
NUM_CATEGORY
assert
len
(
cat_ids
)
==
cfg
.
DATA
.
NUM_CATEGORY
and
len
(
cat_names
)
==
cfg
.
DATA
.
NUM_CATEGORY
self
.
cat_names
=
cat_names
self
.
cat_names
=
cat_names
self
.
class_names
=
[
'BG'
]
+
self
.
cat_names
self
.
class_names
=
[
'BG'
]
+
self
.
cat_names
...
...
examples/FasterRCNN/config.py
View file @
7877a7f7
...
@@ -63,7 +63,7 @@ _C.MODE_FPN = False
...
@@ -63,7 +63,7 @@ _C.MODE_FPN = False
_C
.
DATA
.
BASEDIR
=
'/path/to/your/COCO/DIR'
_C
.
DATA
.
BASEDIR
=
'/path/to/your/COCO/DIR'
_C
.
DATA
.
TRAIN
=
[
'train2014'
,
'valminusminival2014'
]
# i.e., trainval35k
_C
.
DATA
.
TRAIN
=
[
'train2014'
,
'valminusminival2014'
]
# i.e., trainval35k
_C
.
DATA
.
VAL
=
'minival2014'
# For now, only support evaluation on single dataset
_C
.
DATA
.
VAL
=
'minival2014'
# For now, only support evaluation on single dataset
_C
.
DATA
.
NUM_CATEGORY
=
80
# 80 categories
_C
.
DATA
.
NUM_CATEGORY
=
80
# 80 categories
.
_C
.
DATA
.
CLASS_NAMES
=
[]
# NUM_CLASS strings. Needs to be populated later by data loader
_C
.
DATA
.
CLASS_NAMES
=
[]
# NUM_CLASS strings. Needs to be populated later by data loader
# basemodel ----------------------
# basemodel ----------------------
...
...
examples/FasterRCNN/train.py
View file @
7877a7f7
...
@@ -399,7 +399,6 @@ class ResNetFPNModel(DetectionModel):
...
@@ -399,7 +399,6 @@ class ResNetFPNModel(DetectionModel):
def
visualize
(
model
,
model_path
,
nr_visualize
=
100
,
output_dir
=
'output'
):
def
visualize
(
model
,
model_path
,
nr_visualize
=
100
,
output_dir
=
'output'
):
"""
"""
Visualize some intermediate results (proposals, raw predictions) inside the pipeline.
Visualize some intermediate results (proposals, raw predictions) inside the pipeline.
Does not support FPN.
"""
"""
df
=
get_train_dataflow
()
# we don't visualize mask stuff
df
=
get_train_dataflow
()
# we don't visualize mask stuff
df
.
reset_state
()
df
.
reset_state
()
...
...
examples/ImageNetModels/imagenet_utils.py
View file @
7877a7f7
...
@@ -57,7 +57,7 @@ def fbresnet_augmentor(isTrain):
...
@@ -57,7 +57,7 @@ def fbresnet_augmentor(isTrain):
if
isTrain
:
if
isTrain
:
augmentors
=
[
augmentors
=
[
GoogleNetResize
(),
GoogleNetResize
(),
# It's OK to remove the
se
augs if your CPU is not fast enough.
# It's OK to remove the
following
augs if your CPU is not fast enough.
# Removing brightness/contrast/saturation does not have a significant effect on accuracy.
# Removing brightness/contrast/saturation does not have a significant effect on accuracy.
# Removing lighting leads to a tiny drop in accuracy.
# Removing lighting leads to a tiny drop in accuracy.
imgaug
.
RandomOrderAug
(
imgaug
.
RandomOrderAug
(
...
...
tensorpack/input_source/input_source.py
View file @
7877a7f7
...
@@ -48,7 +48,14 @@ class PlaceholderInput(InputSource):
...
@@ -48,7 +48,14 @@ class PlaceholderInput(InputSource):
class
FeedInput
(
InputSource
):
class
FeedInput
(
InputSource
):
""" Input by iterating over a DataFlow and feed datapoints. """
"""
Input by iterating over a DataFlow and feed datapoints.
Note:
If `get_input_tensors()` is called more than one time, it will return the same placeholders (i.e. feed points)
as the first time.
Therefore you can't use it for data-parallel training.
"""
class
_FeedCallback
(
Callback
):
class
_FeedCallback
(
Callback
):
def
__init__
(
self
,
ds
,
placeholders
):
def
__init__
(
self
,
ds
,
placeholders
):
...
...
tensorpack/train/trainers.py
View file @
7877a7f7
...
@@ -14,7 +14,7 @@ from ..utils.develop import HIDE_DOC
...
@@ -14,7 +14,7 @@ from ..utils.develop import HIDE_DOC
from
..tfutils
import
get_global_step_var
from
..tfutils
import
get_global_step_var
from
..tfutils.distributed
import
get_distributed_session_creator
from
..tfutils.distributed
import
get_distributed_session_creator
from
..tfutils.tower
import
TrainTowerContext
from
..tfutils.tower
import
TrainTowerContext
from
..input_source
import
QueueInput
from
..input_source
import
QueueInput
,
FeedfreeInput
from
..graph_builder.training
import
(
from
..graph_builder.training
import
(
SyncMultiGPUParameterServerBuilder
,
SyncMultiGPUParameterServerBuilder
,
...
@@ -59,7 +59,7 @@ class SimpleTrainer(SingleCostTrainer):
...
@@ -59,7 +59,7 @@ class SimpleTrainer(SingleCostTrainer):
# Only exists for type check & back-compatibility
# Only exists for type check & back-compatibility
class
QueueInputTrainer
(
SimpleTrainer
):
class
QueueInputTrainer
(
SimpleTrainer
):
def
_setup_graph
(
self
,
input
,
get_cost_fn
,
get_opt_fn
):
def
_setup_graph
(
self
,
input
,
get_cost_fn
,
get_opt_fn
):
assert
isinstance
(
input
,
QueueInput
)
assert
isinstance
(
input
,
QueueInput
)
,
input
return
super
(
QueueInputTrainer
,
self
)
.
_setup_graph
(
input
,
get_cost_fn
,
get_opt_fn
)
return
super
(
QueueInputTrainer
,
self
)
.
_setup_graph
(
input
,
get_cost_fn
,
get_opt_fn
)
...
@@ -87,6 +87,8 @@ class SyncMultiGPUTrainerParameterServer(SingleCostTrainer):
...
@@ -87,6 +87,8 @@ class SyncMultiGPUTrainerParameterServer(SingleCostTrainer):
super
(
SyncMultiGPUTrainerParameterServer
,
self
)
.
__init__
()
super
(
SyncMultiGPUTrainerParameterServer
,
self
)
.
__init__
()
def
_setup_graph
(
self
,
input
,
get_cost_fn
,
get_opt_fn
):
def
_setup_graph
(
self
,
input
,
get_cost_fn
,
get_opt_fn
):
if
len
(
self
.
devices
)
>
1
:
assert
isinstance
(
input
,
FeedfreeInput
),
input
self
.
train_op
=
self
.
_builder
.
build
(
self
.
train_op
=
self
.
_builder
.
build
(
self
.
_make_get_grad_fn
(
input
,
get_cost_fn
,
get_opt_fn
),
get_opt_fn
)
self
.
_make_get_grad_fn
(
input
,
get_cost_fn
,
get_opt_fn
),
get_opt_fn
)
return
[]
return
[]
...
@@ -124,6 +126,8 @@ class AsyncMultiGPUTrainer(SingleCostTrainer):
...
@@ -124,6 +126,8 @@ class AsyncMultiGPUTrainer(SingleCostTrainer):
super
(
AsyncMultiGPUTrainer
,
self
)
.
__init__
()
super
(
AsyncMultiGPUTrainer
,
self
)
.
__init__
()
def
_setup_graph
(
self
,
input
,
get_cost_fn
,
get_opt_fn
):
def
_setup_graph
(
self
,
input
,
get_cost_fn
,
get_opt_fn
):
if
len
(
self
.
devices
)
>
1
:
assert
isinstance
(
input
,
FeedfreeInput
),
input
self
.
train_op
=
self
.
_builder
.
build
(
self
.
train_op
=
self
.
_builder
.
build
(
self
.
_make_get_grad_fn
(
input
,
get_cost_fn
,
get_opt_fn
),
get_opt_fn
)
self
.
_make_get_grad_fn
(
input
,
get_cost_fn
,
get_opt_fn
),
get_opt_fn
)
return
[]
return
[]
...
@@ -162,6 +166,8 @@ class SyncMultiGPUTrainerReplicated(SingleCostTrainer):
...
@@ -162,6 +166,8 @@ class SyncMultiGPUTrainerReplicated(SingleCostTrainer):
super
(
SyncMultiGPUTrainerReplicated
,
self
)
.
__init__
()
super
(
SyncMultiGPUTrainerReplicated
,
self
)
.
__init__
()
def
_setup_graph
(
self
,
input
,
get_cost_fn
,
get_opt_fn
):
def
_setup_graph
(
self
,
input
,
get_cost_fn
,
get_opt_fn
):
if
len
(
self
.
devices
)
>
1
:
assert
isinstance
(
input
,
FeedfreeInput
),
input
self
.
train_op
,
post_init_op
=
self
.
_builder
.
build
(
self
.
train_op
,
post_init_op
=
self
.
_builder
.
build
(
self
.
_make_get_grad_fn
(
input
,
get_cost_fn
,
get_opt_fn
),
get_opt_fn
)
self
.
_make_get_grad_fn
(
input
,
get_cost_fn
,
get_opt_fn
),
get_opt_fn
)
...
@@ -220,6 +226,7 @@ class DistributedTrainerParameterServer(DistributedTrainerBase):
...
@@ -220,6 +226,7 @@ class DistributedTrainerParameterServer(DistributedTrainerBase):
self
.
is_chief
=
self
.
_builder
.
is_chief
self
.
is_chief
=
self
.
_builder
.
is_chief
def
_setup_graph
(
self
,
input
,
get_cost_fn
,
get_opt_fn
):
def
_setup_graph
(
self
,
input
,
get_cost_fn
,
get_opt_fn
):
assert
isinstance
(
input
,
FeedfreeInput
),
input
self
.
train_op
=
self
.
_builder
.
build
(
self
.
train_op
=
self
.
_builder
.
build
(
self
.
_make_get_grad_fn
(
input
,
get_cost_fn
,
get_opt_fn
),
get_opt_fn
)
self
.
_make_get_grad_fn
(
input
,
get_cost_fn
,
get_opt_fn
),
get_opt_fn
)
return
[]
return
[]
...
@@ -255,6 +262,7 @@ class DistributedTrainerReplicated(DistributedTrainerBase):
...
@@ -255,6 +262,7 @@ class DistributedTrainerReplicated(DistributedTrainerBase):
return
input
.
setup
(
inputs_desc
)
return
input
.
setup
(
inputs_desc
)
def
_setup_graph
(
self
,
input
,
get_cost_fn
,
get_opt_fn
):
def
_setup_graph
(
self
,
input
,
get_cost_fn
,
get_opt_fn
):
assert
isinstance
(
input
,
FeedfreeInput
),
input
self
.
train_op
,
initial_sync_op
,
model_sync_op
=
self
.
_builder
.
build
(
self
.
train_op
,
initial_sync_op
,
model_sync_op
=
self
.
_builder
.
build
(
self
.
_make_get_grad_fn
(
input
,
get_cost_fn
,
get_opt_fn
),
get_opt_fn
)
self
.
_make_get_grad_fn
(
input
,
get_cost_fn
,
get_opt_fn
),
get_opt_fn
)
...
...
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