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
27957082
Commit
27957082
authored
Aug 10, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs update
parent
c94585b4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
docs/conf.py
docs/conf.py
+1
-0
docs/tutorial/graph.md
docs/tutorial/graph.md
+5
-4
tensorpack/dataflow/imgaug/crop.py
tensorpack/dataflow/imgaug/crop.py
+3
-3
tensorpack/dataflow/prefetch.py
tensorpack/dataflow/prefetch.py
+1
-1
No files found.
docs/conf.py
View file @
27957082
...
@@ -363,6 +363,7 @@ def autodoc_skip_member(app, what, name, obj, skip, options):
...
@@ -363,6 +363,7 @@ def autodoc_skip_member(app, what, name, obj, skip, options):
'predictor_factory'
,
'predictor_factory'
,
'get_predictors'
,
'get_predictors'
,
'vs_name_for_predictor'
,
'vs_name_for_predictor'
,
'RandomCropAroundBox'
,
'dump_chkpt_vars'
,
'dump_chkpt_vars'
,
'VisualQA'
,
'VisualQA'
,
'ParamRestore'
]:
'ParamRestore'
]:
...
...
docs/tutorial/graph.md
View file @
27957082
...
@@ -32,19 +32,20 @@ the argument `inputs` is the list of input tensors matching `_get_inputs`.
...
@@ -32,19 +32,20 @@ the argument `inputs` is the list of input tensors matching `_get_inputs`.
You can use any symbolic functions in
`_build_graph`
, including TensorFlow core library
You can use any symbolic functions in
`_build_graph`
, including TensorFlow core library
functions and other symbolic libraries.
functions and other symbolic libraries.
### How i
s it
Used:
### How i
t is
Used:
Most tensorpack trainers expect a
`ModelDesc`
, and use it as a __description
Most tensorpack trainers expect a
`ModelDesc`
, and use it as a __description
of the TF graph
__ (except for the input pipeline)
.
of the TF graph
to be built__
.
These trainers will use
`_get_inputs`
to connect the given
`InputSource`
to the graph.
These trainers will use
`_get_inputs`
to connect the given
`InputSource`
to the graph.
They'll then use
`_build_graph`
to create the backbone model, and then
`_get_optimizer`
to create the minimization op, and run it.
They'll then use
`_build_graph`
to create the backbone model, and then
`_get_optimizer`
to create the minimization op, and run it.
Note that data-parallel multi-GPU trainers will call
`_build_graph`
__multiple times__ on each GPU.
Note that data-parallel multi-GPU trainers will call
`_build_graph`
__multiple times__ on each GPU.
A trainer may also make __extra calls__ to
`_build_graph`
for inference, if used by some callbacks.
A trainer may also make __extra calls__ to
`_build_graph`
for inference, if used by some callbacks.
`_build_graph`
will always be called under some
`TowerContext`
which contains these information
`_build_graph`
will always be called under some
`TowerContext`
which contains these
context
information
(e.g. training or inference, reuse or not, scope name) for your access.
(e.g. training or inference, reuse or not, scope name) for your access.
Also, to respect variable reuse among multiple calls, use
`tf.get_variable()`
instead of
`tf.Variable`
.
Also, to respect variable reuse among multiple calls, use
`tf.get_variable()`
instead of
`tf.Variable`
in
`_build_graph`
,
if you need to create and variables.
### Build It Manually
### Build It Manually
...
...
tensorpack/dataflow/imgaug/crop.py
View file @
27957082
...
@@ -9,8 +9,7 @@ from ...utils.argtools import shape2d
...
@@ -9,8 +9,7 @@ from ...utils.argtools import shape2d
from
six.moves
import
range
from
six.moves
import
range
import
numpy
as
np
import
numpy
as
np
__all__
=
[
'RandomCrop'
,
'CenterCrop'
,
__all__
=
[
'RandomCrop'
,
'CenterCrop'
,
'RandomCropAroundBox'
,
'RandomCropRandomShape'
]
'perturb_BB'
,
'RandomCropAroundBox'
,
'RandomCropRandomShape'
]
class
RandomCrop
(
ImageAugmentor
):
class
RandomCrop
(
ImageAugmentor
):
...
@@ -111,9 +110,10 @@ def perturb_BB(image_shape, bb, max_perturb_pixel,
...
@@ -111,9 +110,10 @@ def perturb_BB(image_shape, bb, max_perturb_pixel,
return
bb
return
bb
# TODO shouldn't include strange augmentors like this.
class
RandomCropAroundBox
(
ImageAugmentor
):
class
RandomCropAroundBox
(
ImageAugmentor
):
"""
"""
Crop a box around a bounding box by some random perturbation
Crop a box around a bounding box by some random perturbation
.
"""
"""
def
__init__
(
self
,
perturb_ratio
,
max_aspect_ratio_diff
=
0.3
):
def
__init__
(
self
,
perturb_ratio
,
max_aspect_ratio_diff
=
0.3
):
...
...
tensorpack/dataflow/prefetch.py
View file @
27957082
...
@@ -150,7 +150,7 @@ class PrefetchDataZMQ(ProxyDataFlow):
...
@@ -150,7 +150,7 @@ class PrefetchDataZMQ(ProxyDataFlow):
nr_proc (int): number of processes to use.
nr_proc (int): number of processes to use.
hwm (int): the zmq "high-water mark" for both sender and receiver.
hwm (int): the zmq "high-water mark" for both sender and receiver.
"""
"""
assert
os
.
name
!=
'nt'
,
"PrefetchDataZMQ doesn't support windows!
Consider PrefetchData instead
."
assert
os
.
name
!=
'nt'
,
"PrefetchDataZMQ doesn't support windows!
PrefetchData might work sometimes
."
super
(
PrefetchDataZMQ
,
self
)
.
__init__
(
ds
)
super
(
PrefetchDataZMQ
,
self
)
.
__init__
(
ds
)
try
:
try
:
self
.
_size
=
ds
.
size
()
self
.
_size
=
ds
.
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