Skip to content

Commit

Permalink
Merge pull request #91 from chengduoZH/feature/add_SE-ResNeXt-152_par…
Browse files Browse the repository at this point in the history
…allel_exe

Add SE-ResNeXt-152_parallel_exe
  • Loading branch information
chengduo committed Apr 2, 2018
2 parents 59b93ad + 1d05993 commit 1c1cfe3
Show file tree
Hide file tree
Showing 4 changed files with 261 additions and 73 deletions.
16 changes: 16 additions & 0 deletions fluid/SE-ResNeXt-152/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Benchmark SE-ResNeXt-152

## For single card:
```
env CUDA_VISIBLE_DEVICES=0 python train.py --use_parallel_mode=parallel_do --use_nccl=False --parallel=False --display_step=1
```

## For multi-card:
### use parallel_do
```
env CUDA_VISIBLE_DEVICES=4,5,6,7 python train.py --use_parallel_mode=parallel_do --use_nccl=True --parallel=True --display_step=1
```
### use parallel_exe
```
env CUDA_VISIBLE_DEVICES=4,5,6,7 python train.py --use_parallel_mode=parallel_exe --use_nccl=True --parallel=True --display_step=1
```
34 changes: 34 additions & 0 deletions fluid/SE-ResNeXt-152/generate_flowers_recordio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import numpy as np
import paddle
import paddle.fluid as fluid
import paddle.dataset.flowers as flowers

batch_size = 12
data_shape = [3, 224, 224]

with fluid.program_guard(fluid.Program(), fluid.Program()):
reader = paddle.batch(flowers.train(), batch_size=batch_size)
feeder = fluid.DataFeeder(
feed_list=[ # order is image and label
fluid.layers.data(
name='image', shape=data_shape, dtype='float32'),
fluid.layers.data(
name='label', shape=[1], dtype='int64'),
],
place=fluid.CPUPlace())
fluid.recordio_writer.convert_reader_to_recordio_file(
'./flowers_bs_12_3_224_224.recordio', reader, feeder)
1 change: 0 additions & 1 deletion fluid/SE-ResNeXt-152/run.sh

This file was deleted.

Loading

0 comments on commit 1c1cfe3

Please sign in to comment.