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
1b27a59b
Commit
1b27a59b
authored
Oct 12, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update docs
parent
0f0a9ad7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
docs/tutorial/efficient-dataflow.md
docs/tutorial/efficient-dataflow.md
+2
-2
tensorpack/dataflow/prefetch.py
tensorpack/dataflow/prefetch.py
+3
-3
No files found.
docs/tutorial/efficient-dataflow.md
View file @
1b27a59b
...
@@ -140,7 +140,7 @@ We can also dump the dataset into one single LMDB file and read it sequentially.
...
@@ -140,7 +140,7 @@ We can also dump the dataset into one single LMDB file and read it sequentially.
```
python
```
python
from
tensorpack.dataflow
import
*
from
tensorpack.dataflow
import
*
class
BinaryILSVRC12
(
ILSVRCFiles
):
class
BinaryILSVRC12
(
dataset
.
ILSVRCFiles
):
def
get_data
(
self
):
def
get_data
(
self
):
for
fname
,
label
in
super
(
BinaryILSVRC12
,
self
)
.
get_data
():
for
fname
,
label
in
super
(
BinaryILSVRC12
,
self
)
.
get_data
():
with
open
(
fname
,
'rb'
)
as
f
:
with
open
(
fname
,
'rb'
)
as
f
:
...
@@ -155,7 +155,7 @@ The above script builds a DataFlow which produces jpeg-encoded ImageNet data.
...
@@ -155,7 +155,7 @@ 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
)
See
[
documentation
](
http://
tensorpack.readthedocs.io/en/latest
/modules/dataflow.html#tensorpack.dataflow.PrefetchDataZMQ
)
about caveats of
`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/dataflow/prefetch.py
View file @
1b27a59b
...
@@ -126,9 +126,9 @@ class PrefetchDataZMQ(ProxyDataFlow):
...
@@ -126,9 +126,9 @@ 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. An iterator cannot run faster automatically --
the underlying dataflow worker
1. An iterator cannot run faster automatically --
what's happenning is
will be forked ``nr_proc`` times. As a result, we have the following
that the underlying dataflow will be forked ``nr_proc`` times.
guarantee on the dataflow correctness:
As a result, we have the following
guarantee on the dataflow correctness:
a. When ``nr_proc=1``, the dataflow produces the same data as ``ds`` in the same order.
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
b. When ``nr_proc>1``, the dataflow produces the same distribution
...
...
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