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
f34f454e
Commit
f34f454e
authored
Nov 27, 2018
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update docs; workaround TF bug
parent
c4a68c6c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
12 deletions
+15
-12
examples/FasterRCNN/README.md
examples/FasterRCNN/README.md
+5
-4
setup.py
setup.py
+1
-1
tensorpack/callbacks/prof.py
tensorpack/callbacks/prof.py
+2
-2
tensorpack/train/trainers.py
tensorpack/train/trainers.py
+4
-4
tensorpack/utils/concurrency.py
tensorpack/utils/concurrency.py
+2
-1
tensorpack/utils/serialize.py
tensorpack/utils/serialize.py
+1
-0
No files found.
examples/FasterRCNN/README.md
View file @
f34f454e
...
@@ -8,7 +8,7 @@ This example provides a minimal (2k lines) and faithful implementation of the fo
...
@@ -8,7 +8,7 @@ This example provides a minimal (2k lines) and faithful implementation of the fo
with the support of:
with the support of:
+
Multi-GPU / distributed training
+
Multi-GPU / distributed training
+
[
Cross-GPU BatchNorm
](
https://arxiv.org/abs/1711.07240
)
+
Cross-GPU BatchNorm (from
[
MegDet: A Large Mini-Batch Object Detector
](
https://arxiv.org/abs/1711.07240
)
)
+
[
Group Normalization
](
https://arxiv.org/abs/1803.08494
)
+
[
Group Normalization
](
https://arxiv.org/abs/1803.08494
)
## Dependencies
## Dependencies
...
@@ -56,7 +56,6 @@ Options can be changed by either the command line or the `config.py` file.
...
@@ -56,7 +56,6 @@ Options can be changed by either the command line or the `config.py` file.
Recommended configurations are listed in the table below.
Recommended configurations are listed in the table below.
The code is only valid for training with 1, 2, 4 or >=8 GPUs.
The code is only valid for training with 1, 2, 4 or >=8 GPUs.
Not training with 8 GPUs may result in different performance from the table below.
### Inference:
### Inference:
...
@@ -77,11 +76,13 @@ prediction will need to be run with the corresponding training configs.
...
@@ -77,11 +76,13 @@ prediction will need to be run with the corresponding training configs.
## Results
## Results
These models are trained on trainval35k and evaluated on minival2014 using mAP@IoU=0.50:0.95.
These models are trained on trainval35k and evaluated on minival2014 using mAP@IoU=0.50:0.95.
All models are fine-tuned from ImageNet pre-trained R50/R101 models in the
[
model zoo
](
http://models.tensorpack.com/FasterRCNN/
)
.
All models are fine-tuned from ImageNet pre-trained R50/R101 models in the
[
model zoo
](
http://models.tensorpack.com/FasterRCNN/
)
, unless otherwise noted.
All models are trained with 8 NVIDIA V100s, unless otherwise noted.
Performance in
[
Detectron
](
https://github.com/facebookresearch/Detectron/
)
can be roughly reproduced.
Performance in
[
Detectron
](
https://github.com/facebookresearch/Detectron/
)
can be roughly reproduced.
Mask R-CNN results contain both box and mask mAP.
Mask R-CNN results contain both box and mask mAP.
| Backbone | mAP
<br/>
(box;mask) | Detectron mAP
<sup>
[
1
](
#ft1
)
</sup><br/>
(box;mask) | Time
on 8 V100s
| Configurations
<br/>
(click to expand) |
| Backbone | mAP
<br/>
(box;mask) | Detectron mAP
<sup>
[
1
](
#ft1
)
</sup><br/>
(box;mask) | Time
(on 8 V100s)
| Configurations
<br/>
(click to expand) |
| - | - | - | - | - |
| - | - | - | - | - |
| R50-C4 | 33.1 | | 18h |
<details><summary>
super quick
</summary>
`MODE_MASK=False FRCNN.BATCH_PER_IM=64`
<br/>
`PREPROC.SHORT_EDGE_SIZE=600 PREPROC.MAX_SIZE=1024`
<br/>
`TRAIN.LR_SCHEDULE=[150000,230000,280000]`
</details>
|
| R50-C4 | 33.1 | | 18h |
<details><summary>
super quick
</summary>
`MODE_MASK=False FRCNN.BATCH_PER_IM=64`
<br/>
`PREPROC.SHORT_EDGE_SIZE=600 PREPROC.MAX_SIZE=1024`
<br/>
`TRAIN.LR_SCHEDULE=[150000,230000,280000]`
</details>
|
| R50-C4 | 36.6 | 36.5 | 44h |
<details><summary>
standard
</summary>
`MODE_MASK=False`
</details>
|
| R50-C4 | 36.6 | 36.5 | 44h |
<details><summary>
standard
</summary>
`MODE_MASK=False`
</details>
|
...
...
setup.py
View file @
f34f454e
...
@@ -29,7 +29,7 @@ setup(
...
@@ -29,7 +29,7 @@ setup(
"tabulate>=0.7.7"
,
"tabulate>=0.7.7"
,
"tqdm>4.11.1"
,
"tqdm>4.11.1"
,
"msgpack>=0.5.2"
,
"msgpack>=0.5.2"
,
"msgpack-numpy>=0.4.
0
"
,
"msgpack-numpy>=0.4.
4.2
"
,
"pyzmq>=16"
,
"pyzmq>=16"
,
"subprocess32; python_version < '3.0'"
,
"subprocess32; python_version < '3.0'"
,
"functools32; python_version < '3.0'"
,
"functools32; python_version < '3.0'"
,
...
...
tensorpack/callbacks/prof.py
View file @
f34f454e
...
@@ -53,7 +53,7 @@ class GPUUtilizationTracker(Callback):
...
@@ -53,7 +53,7 @@ class GPUUtilizationTracker(Callback):
assert
len
(
self
.
_devices
),
"[GPUUtilizationTracker] No GPU device given!"
assert
len
(
self
.
_devices
),
"[GPUUtilizationTracker] No GPU device given!"
def
_before_train
(
self
):
def
_before_train
(
self
):
assert
tf
.
test
.
is_gpu_available
()
#
assert tf.test.is_gpu_available()
self
.
_evt
=
mp
.
Event
()
self
.
_evt
=
mp
.
Event
()
self
.
_stop_evt
=
mp
.
Event
()
self
.
_stop_evt
=
mp
.
Event
()
self
.
_queue
=
mp
.
Queue
()
self
.
_queue
=
mp
.
Queue
()
...
@@ -213,7 +213,7 @@ class PeakMemoryTracker(Callback):
...
@@ -213,7 +213,7 @@ class PeakMemoryTracker(Callback):
self
.
_fetches
=
tf
.
train
.
SessionRunArgs
(
fetches
=
ops
)
self
.
_fetches
=
tf
.
train
.
SessionRunArgs
(
fetches
=
ops
)
def
_before_run
(
self
,
_
):
def
_before_run
(
self
,
_
):
assert
tf
.
test
.
is_gpu_available
(),
"PeakMemoryTracker only supports GPU!"
#
assert tf.test.is_gpu_available(), "PeakMemoryTracker only supports GPU!"
if
self
.
local_step
==
self
.
trainer
.
steps_per_epoch
-
1
:
if
self
.
local_step
==
self
.
trainer
.
steps_per_epoch
-
1
:
return
self
.
_fetches
return
self
.
_fetches
return
None
return
None
...
...
tensorpack/train/trainers.py
View file @
f34f454e
...
@@ -310,7 +310,7 @@ class HorovodTrainer(SingleCostTrainer):
...
@@ -310,7 +310,7 @@ class HorovodTrainer(SingleCostTrainer):
.. code-block:: bash
.. code-block:: bash
# First, change trainer to HorovodTrainer(), then
# First, change trainer to HorovodTrainer(), then
CUDA_VISIBLE_DEVICES=0,1,2,3 mpirun -np 4 --output-filename mylog python train.py
CUDA_VISIBLE_DEVICES=0,1,2,3
NCCL_DEBUG=INFO
mpirun -np 4 --output-filename mylog python train.py
To use for distributed training:
To use for distributed training:
...
@@ -319,7 +319,7 @@ class HorovodTrainer(SingleCostTrainer):
...
@@ -319,7 +319,7 @@ class HorovodTrainer(SingleCostTrainer):
# First, change trainer to HorovodTrainer(), then
# First, change trainer to HorovodTrainer(), then
mpirun -np 8 -H server1:4,server2:4
\\
mpirun -np 8 -H server1:4,server2:4
\\
-bind-to none -map-by slot
\\
-bind-to none -map-by slot
\\
--output-filename mylog -x LD_LIBRARY_PATH
\\
--output-filename mylog
-x NCCL_DEBUG=INFO
-x LD_LIBRARY_PATH
\\
python train.py
python train.py
# Add other environment variables you need by -x, e.g. PYTHONPATH, PATH.
# Add other environment variables you need by -x, e.g. PYTHONPATH, PATH.
# If using all GPUs, you can always skip the `CUDA_VISIBLE_DEVICES` option.
# If using all GPUs, you can always skip the `CUDA_VISIBLE_DEVICES` option.
...
@@ -430,8 +430,8 @@ class HorovodTrainer(SingleCostTrainer):
...
@@ -430,8 +430,8 @@ class HorovodTrainer(SingleCostTrainer):
except
AttributeError
:
# old horovod does not have local_size
except
AttributeError
:
# old horovod does not have local_size
pass
pass
super
(
HorovodTrainer
,
self
)
.
initialize
(
session_creator
,
session_init
)
super
(
HorovodTrainer
,
self
)
.
initialize
(
session_creator
,
session_init
)
if
not
tf
.
test
.
is_gpu_available
():
#
if not tf.test.is_gpu_available():
logger
.
error
(
"tf.test.is_gpu_available() == False"
)
#
logger.error("tf.test.is_gpu_available() == False")
# This broadcast belongs to the "intialize" stage
# This broadcast belongs to the "intialize" stage
# It should not be delayed to the "before_train" stage.
# It should not be delayed to the "before_train" stage.
...
...
tensorpack/utils/concurrency.py
View file @
f34f454e
...
@@ -185,7 +185,8 @@ def enable_death_signal(_warn=True):
...
@@ -185,7 +185,8 @@ def enable_death_signal(_warn=True):
import
prctl
# pip install python-prctl
import
prctl
# pip install python-prctl
except
ImportError
:
except
ImportError
:
if
_warn
:
if
_warn
:
log_once
(
'Install python-prctl so that processes can be cleaned with guarantee.'
,
'warn'
)
log_once
(
'"import prctl" failed! Install python-prctl so that processes can be cleaned with guarantee.'
,
'warn'
)
return
return
else
:
else
:
assert
hasattr
(
prctl
,
'set_pdeathsig'
),
\
assert
hasattr
(
prctl
,
'set_pdeathsig'
),
\
...
...
tensorpack/utils/serialize.py
View file @
f34f454e
...
@@ -65,6 +65,7 @@ try:
...
@@ -65,6 +65,7 @@ try:
import
msgpack
import
msgpack
import
msgpack_numpy
import
msgpack_numpy
msgpack_numpy
.
patch
()
msgpack_numpy
.
patch
()
assert
msgpack
.
version
>=
(
0
,
5
,
2
)
except
ImportError
:
except
ImportError
:
loads_msgpack
=
create_dummy_func
(
# noqa
loads_msgpack
=
create_dummy_func
(
# noqa
'loads_msgpack'
,
[
'msgpack'
,
'msgpack_numpy'
])
'loads_msgpack'
,
[
'msgpack'
,
'msgpack_numpy'
])
...
...
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