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
560bc84e
Commit
560bc84e
authored
Oct 10, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update docs
parent
ae818ecd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
docs/tutorial/efficient-dataflow.md
docs/tutorial/efficient-dataflow.md
+2
-0
tensorpack/callbacks/monitor.py
tensorpack/callbacks/monitor.py
+2
-1
tensorpack/dataflow/prefetch.py
tensorpack/dataflow/prefetch.py
+9
-4
No files found.
docs/tutorial/efficient-dataflow.md
View file @
560bc84e
...
@@ -155,6 +155,8 @@ The above script builds a DataFlow which produces jpeg-encoded ImageNet data.
...
@@ -155,6 +155,8 @@ The above script builds a DataFlow which produces jpeg-encoded ImageNet data.
We store the jpeg string as a numpy array because the function
`cv2.imdecode`
later expect this format.
We store the jpeg string as a numpy array because the function
`cv2.imdecode`
later expect this format.
Please note we can only use 1 prefetch process to speed up. If
`nr_proc>1`
,
`ds1`
will take data
Please note we can only use 1 prefetch process to speed up. If
`nr_proc>1`
,
`ds1`
will take data
from several forks of
`ds0`
, then neither the content nor the order of
`ds1`
will be the same as
`ds0`
.
from several forks of
`ds0`
, then neither the content nor the order of
`ds1`
will be the same as
`ds0`
.
See
[
documentation
](
http://localhost:8000/modules/dataflow.html#tensorpack.dataflow.PrefetchDataZMQ
)
about caveats of
`PrefetchDataZMQ`
.
It will generate a database file of 140G. We build a DataFlow to read this LMDB file sequentially:
It will generate a database file of 140G. We build a DataFlow to read this LMDB file sequentially:
```
```
...
...
tensorpack/callbacks/monitor.py
View file @
560bc84e
...
@@ -151,6 +151,7 @@ class Monitors(Callback):
...
@@ -151,6 +151,7 @@ class Monitors(Callback):
def
put_image
(
self
,
name
,
val
):
def
put_image
(
self
,
name
,
val
):
"""
"""
Put an image.
Put an image.
Args:
Args:
name (str):
name (str):
val (np.ndarray): 2D, 3D (HWC) or 4D (NHWC) numpy array of images
val (np.ndarray): 2D, 3D (HWC) or 4D (NHWC) numpy array of images
...
...
tensorpack/dataflow/prefetch.py
View file @
560bc84e
...
@@ -126,10 +126,15 @@ class PrefetchDataZMQ(ProxyDataFlow):
...
@@ -126,10 +126,15 @@ class PrefetchDataZMQ(ProxyDataFlow):
collect datapoints from `ds` in each process by ZeroMQ IPC pipe.
collect datapoints from `ds` in each process by ZeroMQ IPC pipe.
Note:
Note:
1. The underlying dataflow worker will be forked multiple times When ``nr_proc>1``.
1. An iterator cannot run faster automatically -- the underlying dataflow worker
As a result, unless the underlying dataflow is fully shuffled, the data distribution
will be forked ``nr_proc`` times. As a result, we have the following
produced by this dataflow will be different.
guarantee on the dataflow correctness:
(e.g. you are likely to see duplicated datapoints at the beginning)
a. When ``nr_proc=1``, the dataflow produces the same data as ``ds`` in the same order.
b. When ``nr_proc>1``, the dataflow produces the same distribution
of data as ``ds`` if each sample from ``ds`` is i.i.d. (e.g. fully shuffled).
You probably only want to use it for training.
2. Once :meth:`reset_state` is called, this dataflow becomes not fork-safe.
2. Once :meth:`reset_state` is called, this dataflow becomes not fork-safe.
i.e., if you fork an already reset instance of this dataflow,
i.e., if you fork an already reset instance of this dataflow,
it won't be usable in the forked process.
it won't be usable in the forked process.
...
...
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