Skip to content

Commit 1c1cfe3

Browse files
author
chengduo
authored
Merge pull request #91 from chengduoZH/feature/add_SE-ResNeXt-152_parallel_exe
Add SE-ResNeXt-152_parallel_exe
2 parents 59b93ad + 1d05993 commit 1c1cfe3

File tree

4 files changed

+261
-73
lines changed

4 files changed

+261
-73
lines changed

fluid/SE-ResNeXt-152/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Benchmark SE-ResNeXt-152
2+
3+
## For single card:
4+
```
5+
env CUDA_VISIBLE_DEVICES=0 python train.py --use_parallel_mode=parallel_do --use_nccl=False --parallel=False --display_step=1
6+
```
7+
8+
## For multi-card:
9+
### use parallel_do
10+
```
11+
env CUDA_VISIBLE_DEVICES=4,5,6,7 python train.py --use_parallel_mode=parallel_do --use_nccl=True --parallel=True --display_step=1
12+
```
13+
### use parallel_exe
14+
```
15+
env CUDA_VISIBLE_DEVICES=4,5,6,7 python train.py --use_parallel_mode=parallel_exe --use_nccl=True --parallel=True --display_step=1
16+
```
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import numpy as np
16+
import paddle
17+
import paddle.fluid as fluid
18+
import paddle.dataset.flowers as flowers
19+
20+
batch_size = 12
21+
data_shape = [3, 224, 224]
22+
23+
with fluid.program_guard(fluid.Program(), fluid.Program()):
24+
reader = paddle.batch(flowers.train(), batch_size=batch_size)
25+
feeder = fluid.DataFeeder(
26+
feed_list=[ # order is image and label
27+
fluid.layers.data(
28+
name='image', shape=data_shape, dtype='float32'),
29+
fluid.layers.data(
30+
name='label', shape=[1], dtype='int64'),
31+
],
32+
place=fluid.CPUPlace())
33+
fluid.recordio_writer.convert_reader_to_recordio_file(
34+
'./flowers_bs_12_3_224_224.recordio', reader, feeder)

fluid/SE-ResNeXt-152/run.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)