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
8ab0d4a6
Commit
8ab0d4a6
authored
Apr 30, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update docs
parent
d7a13cb7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
examples/FasterRCNN/data.py
examples/FasterRCNN/data.py
+2
-1
tensorpack/dataflow/parallel.py
tensorpack/dataflow/parallel.py
+6
-3
tensorpack/train/config.py
tensorpack/train/config.py
+3
-0
No files found.
examples/FasterRCNN/data.py
View file @
8ab0d4a6
...
@@ -369,11 +369,12 @@ def get_train_dataflow():
...
@@ -369,11 +369,12 @@ def get_train_dataflow():
return
ret
return
ret
if
cfg
.
DATA
.
NUM_WORKERS
>
0
:
if
cfg
.
DATA
.
NUM_WORKERS
>
0
:
buffer_size
=
cfg
.
DATA
.
NUM_WORKERS
*
20
if
cfg
.
TRAINER
==
'horovod'
:
if
cfg
.
TRAINER
==
'horovod'
:
buffer_size
=
cfg
.
DATA
.
NUM_WORKERS
*
10
# one dataflow for each process, therefore don't need large buffer
ds
=
MultiThreadMapData
(
ds
,
cfg
.
DATA
.
NUM_WORKERS
,
preprocess
,
buffer_size
=
buffer_size
)
ds
=
MultiThreadMapData
(
ds
,
cfg
.
DATA
.
NUM_WORKERS
,
preprocess
,
buffer_size
=
buffer_size
)
# MPI does not like fork()
# MPI does not like fork()
else
:
else
:
buffer_size
=
cfg
.
DATA
.
NUM_WORKERS
*
20
ds
=
MultiProcessMapDataZMQ
(
ds
,
cfg
.
DATA
.
NUM_WORKERS
,
preprocess
,
buffer_size
=
buffer_size
)
ds
=
MultiProcessMapDataZMQ
(
ds
,
cfg
.
DATA
.
NUM_WORKERS
,
preprocess
,
buffer_size
=
buffer_size
)
else
:
else
:
ds
=
MapData
(
ds
,
preprocess
)
ds
=
MapData
(
ds
,
preprocess
)
...
...
tensorpack/dataflow/parallel.py
View file @
8ab0d4a6
...
@@ -144,7 +144,8 @@ class MultiProcessPrefetchData(ProxyDataFlow):
...
@@ -144,7 +144,8 @@ class MultiProcessPrefetchData(ProxyDataFlow):
`Birthday Paradox <https://en.wikipedia.org/wiki/Birthday_problem>`_
`Birthday Paradox <https://en.wikipedia.org/wiki/Birthday_problem>`_
and know that you'll likely see duplicates.
and know that you'll likely see duplicates.
To utilize parallelism with stricter data integrity, you can use the parallel versions of `MapData`.
To utilize parallelism with more strict data integrity, you can use
the parallel versions of :class:`MapData`: :class:`MultiThreadMapData`, :class:`MultiProcessMapData`.
2. This has more serialization overhead than :class:`PrefetchDataZMQ` when data is large.
2. This has more serialization overhead than :class:`PrefetchDataZMQ` when data is large.
3. You can nest like this: ``PrefetchDataZMQ(PrefetchData(df, nr_proc=a), nr_proc=b)``.
3. You can nest like this: ``PrefetchDataZMQ(PrefetchData(df, nr_proc=a), nr_proc=b)``.
A total of ``a`` instances of ``df`` worker processes will be created.
A total of ``a`` instances of ``df`` worker processes will be created.
...
@@ -241,7 +242,8 @@ class PrefetchDataZMQ(_MultiProcessZMQDataFlow):
...
@@ -241,7 +242,8 @@ class PrefetchDataZMQ(_MultiProcessZMQDataFlow):
`Birthday Paradox <https://en.wikipedia.org/wiki/Birthday_problem>`_
`Birthday Paradox <https://en.wikipedia.org/wiki/Birthday_problem>`_
and know that you'll likely see duplicates.
and know that you'll likely see duplicates.
To utilize parallelism with stricter data integrity, you can use the parallel versions of `MapData`.
To utilize parallelism with more strict data integrity, you can use
the parallel versions of :class:`MapData`: :class:`MultiThreadMapData`, :class:`MultiProcessMapData`.
2. `reset_state()` of the given dataflow will be called **once and only once** in the worker processes.
2. `reset_state()` of the given dataflow will be called **once and only once** in the worker processes.
3. The fork of processes happened in this dataflow's `reset_state()` method.
3. The fork of processes happened in this dataflow's `reset_state()` method.
Please note that forking a TensorFlow GPU session may be unsafe.
Please note that forking a TensorFlow GPU session may be unsafe.
...
@@ -365,7 +367,8 @@ class MultiThreadPrefetchData(DataFlow):
...
@@ -365,7 +367,8 @@ class MultiThreadPrefetchData(DataFlow):
`Birthday Paradox <https://en.wikipedia.org/wiki/Birthday_problem>`_
`Birthday Paradox <https://en.wikipedia.org/wiki/Birthday_problem>`_
and know that you'll likely see duplicates.
and know that you'll likely see duplicates.
To utilize parallelism with stricter data integrity, you can use the parallel versions of `MapData`.
To utilize parallelism with more strict data integrity, you can use
the parallel versions of :class:`MapData`: :class:`MultiThreadMapData`, :class:`MultiProcessMapData`.
"""
"""
class
_Worker
(
StoppableThread
):
class
_Worker
(
StoppableThread
):
...
...
tensorpack/train/config.py
View file @
8ab0d4a6
...
@@ -94,6 +94,9 @@ class TrainConfig(object):
...
@@ -94,6 +94,9 @@ class TrainConfig(object):
starting_epoch (int): The index of the first epoch.
starting_epoch (int): The index of the first epoch.
steps_per_epoch (int): the number of steps (defined by :meth:`Trainer.run_step`) to run in each epoch.
steps_per_epoch (int): the number of steps (defined by :meth:`Trainer.run_step`) to run in each epoch.
Defaults to the input data size. You may want to divide it by the #GPUs in multi-GPU training.
Defaults to the input data size. You may want to divide it by the #GPUs in multi-GPU training.
Number of steps per epoch only affects the schedule of callbacks.
It does not affect the sequence of input data seen by the model.
max_epoch (int): maximum number of epoch to run training.
max_epoch (int): maximum number of epoch to run training.
"""
"""
...
...
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