Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add script for training #928

Merged
merged 2 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion paddleseg/core/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def train(model,

if fp16:
with paddle.amp.auto_cast(
enable=True, custom_black_list={'bilinear_interp_v2'}):
enable=True, custom_white_list={"elementwise_add", "batch_norm"}, custom_black_list={'bilinear_interp_v2'}):
if nranks > 1:
logits_list = ddp_model(images)
else:
Expand Down
12 changes: 12 additions & 0 deletions script/run_fp16.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export FLAGS_conv_workspace_size_limit=2000 #MB
export FLAGS_cudnn_exhaustive_search=1
export FLAGS_cudnn_batchnorm_spatial_persistent=1

python train.py --config benchmark/deeplabv3p.yml \
--iters=500 \
--batch_size 4 \
--learning_rate 0.01 \
--num_workers 8 \
--log_iters 20 \
--data_format NHWC \
--fp16
11 changes: 11 additions & 0 deletions script/run_fp32.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export FLAGS_conv_workspace_size_limit=2000 #MB
export FLAGS_cudnn_exhaustive_search=1
export FLAGS_cudnn_batchnorm_spatial_persistent=1

python train.py --config benchmark/deeplabv3p.yml \
--iters=500 \
--batch_size 2 \
--learning_rate 0.01 \
--num_workers 8 \
--log_iters 20 \
--data_format NCHW \