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):
'predictor_factory'
,
'get_predictors'
,
'vs_name_for_predictor'
,
'RandomCropAroundBox'
,
'dump_chkpt_vars'
,
'VisualQA'
,
'ParamRestore'
]:
...
...
docs/tutorial/graph.md
View file @
27957082
...
...
@@ -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
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
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.
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.
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.
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
...
...
tensorpack/dataflow/imgaug/crop.py
View file @
27957082
...
...
@@ -9,8 +9,7 @@ from ...utils.argtools import shape2d
from
six.moves
import
range
import
numpy
as
np
__all__
=
[
'RandomCrop'
,
'CenterCrop'
,
'perturb_BB'
,
'RandomCropAroundBox'
,
'RandomCropRandomShape'
]
__all__
=
[
'RandomCrop'
,
'CenterCrop'
,
'RandomCropAroundBox'
,
'RandomCropRandomShape'
]
class
RandomCrop
(
ImageAugmentor
):
...
...
@@ -111,9 +110,10 @@ def perturb_BB(image_shape, bb, max_perturb_pixel,
return
bb
# TODO shouldn't include strange augmentors like this.
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
):
...
...
tensorpack/dataflow/prefetch.py
View file @
27957082
...
...
@@ -150,7 +150,7 @@ class PrefetchDataZMQ(ProxyDataFlow):
nr_proc (int): number of processes to use.
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
)
try
:
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