-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from chengduoZH/feature/add_SE-ResNeXt-152_par…
…allel_exe Add SE-ResNeXt-152_parallel_exe
- Loading branch information
Showing
4 changed files
with
261 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.