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

[Enhancement] Refine User Scripts #2849

Merged
merged 15 commits into from
Dec 29, 2022
Prev Previous commit
Next Next commit
update to_static_training params
  • Loading branch information
juncaipeng committed Dec 15, 2022
commit 2c9b14c735db7607f7cd6e83d86a82bfe734fa39
3 changes: 0 additions & 3 deletions paddleseg/cvlibs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,6 @@ def update_config_dict(dic: dict,
assert subkey in tmp_dic, "Can not update {}, because it is not in config.".format(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不允许创建新的key了吗?会不会存在默认参数原先不存在于yaml而需要传入的情况呢?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

防止设置错误吧

key)
tmp_dic = tmp_dic[subkey]
assert key_list[
-1] in tmp_dic, "Can not update {}, because it is not in config.".format(
key)
tmp_dic[key_list[-1]] = value

return dic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ epoch:150
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096;FLAGS_cudnn_deterministic=False
log_iters:5;repeats:500
===========================to_static_train_benchmark_params===========================
to_static_train:--opts to_static_training True
to_static_train:--opts to_static_training=True
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ flags:FLAGS_cudnn_exhaustive_search=1;FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fra
===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,512,1024]}]
===========================to_static_train_benchmark_params===========================
to_static_train:--opts to_static_training True
to_static_train:--opts to_static_training=True
2 changes: 1 addition & 1 deletion test_tipc/configs/fastscnn/train_infer_python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ epoch:2000
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096;FLAGS_cudnn_deterministic=False
log_iters:15;skip_iters:2;repeats:1000
===========================to_static_train_benchmark_params===========================
to_static_train:--opts to_static_training True
to_static_train:--opts to_static_training=True
2 changes: 1 addition & 1 deletion test_tipc/configs/ocrnet_hrnetw48/train_infer_python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ epoch:500
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096;FLAGS_cudnn_deterministic=False
log_iters:5;skip_iters:3;repeats:500
===========================to_static_train_benchmark_params===========================
to_static_train:--opts to_static_training True
to_static_train:--opts to_static_training=True
2 changes: 1 addition & 1 deletion test_tipc/configs/pp_liteseg_stdc1/train_infer_python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ epoch:400
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096;FLAGS_cudnn_deterministic=False
log_iters:10;skip_iters:2;repeats:500
===========================to_static_train_benchmark_params===========================
to_static_train:--opts to_static_training True
to_static_train:--opts to_static_training=True
2 changes: 1 addition & 1 deletion test_tipc/configs/pphumanseg_lite/train_infer_python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ epoch:300
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096;FLAGS_cudnn_deterministic=False
repeats:500
===========================to_static_train_benchmark_params===========================
to_static_train:--opts to_static_training True
to_static_train:--opts to_static_training=True
2 changes: 1 addition & 1 deletion test_tipc/configs/segformer_b0/train_infer_python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ epoch:800
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096;FLAGS_cudnn_deterministic=False
log_iters:15;skip_iters:2;repeats:500
===========================to_static_train_benchmark_params===========================
to_static_train:--opts to_static_training True
to_static_train:--opts to_static_training=True
2 changes: 1 addition & 1 deletion test_tipc/configs/sfnet/train_infer_python.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ epoch:400
flags:FLAGS_eager_delete_tensor_gb=0.0;FLAGS_fraction_of_gpu_memory_to_use=0.98;FLAGS_conv_workspace_size_limit=4096;FLAGS_cudnn_deterministic=False
log_iters:15;skip_iters:2;repeats:500
===========================to_static_train_benchmark_params===========================
to_static_train:--opts to_static_training True
to_static_train:--opts to_static_training=True
2 changes: 1 addition & 1 deletion test_tipc/test_train_dy2static_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ do
# start dy2static train
dy2static_output=$LOG_PATH/${config_name}_python_train_infer_dy2static_output.txt
dy2static_loss=$LOG_PATH/${config_name}_dy2static_loss.txt
sed -i '16s/$/ --opts to_static_training True/' ${FILENAME}
sed -i '16s/$/ --opts to_static_training=True/' ${FILENAME}
cmd="bash test_tipc/test_train_inference_python.sh ${FILENAME} $MODE >$dy2static_output 2>&1"
echo $cmd
eval $cmd
Expand Down