[Test] Optimize CI (#28)

own
Lin Manhui 2 years ago committed by GitHub
parent 7371bf76b9
commit f267908f36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      .github/workflows/build.yaml
  2. 2
      README.md
  3. 2
      docs/apis/train.md
  4. 2
      paddlers/tasks/segmenter.py
  5. 2
      test_tipc/configs/seg/unet/unet.yaml
  6. 6
      tests/rs_models/test_model.py
  7. 7
      tests/run_ci_dev.sh
  8. 13
      tests/run_tipc_lite.sh

@ -1,4 +1,4 @@
name: build and test
name: build
on:
push:
@ -17,7 +17,7 @@ concurrency:
cancel-in-progress: true
jobs:
build_and_test_cpu:
build_cpu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
@ -53,8 +53,3 @@ jobs:
python -m pip install -e .
- name: Install GDAL
run: python -m pip install ${{ matrix.gdal-whl-url }}
- name: Run unittests
run: |
cd tests
bash run_fast_tests.sh
shell: bash

@ -8,7 +8,7 @@
<!-- [![version](https://img.shields.io/github/release/PaddlePaddle/PaddleRS.svg)](https://github.com/PaddlePaddle/PaddleRS/releases) -->
[![license](https://img.shields.io/badge/license-Apache%202-blue.svg)](LICENSE)
[![build status](https://github.com/PaddlePaddle/PaddleRS/actions/workflows/build_and_test.yaml/badge.svg?branch=develop)](https://github.com/PaddlePaddle/PaddleRS/actions)
[![build status](https://github.com/PaddlePaddle/PaddleRS/actions/workflows/build.yaml/badge.svg?branch=develop)](https://github.com/PaddlePaddle/PaddleRS/actions)
![python version](https://img.shields.io/badge/python-3.7+-orange.svg)
![support os](https://img.shields.io/badge/os-linux%2C%20win%2C%20mac-yellow.svg)
</div>

@ -25,7 +25,7 @@
### 初始化`BaseSegmenter`子类对象
- 一般支持设置`input_channel`、`num_classes`以及`use_mixed_loss`参数,分别表示输入通道数、输出类别数以及是否使用预置的混合损失。部分模型如`FarSeg`暂不支持对`input_channel`参数的设置。
- 一般支持设置`in_channels`、`num_classes`以及`use_mixed_loss`参数,分别表示输入通道数、输出类别数以及是否使用预置的混合损失。部分模型如`FarSeg`暂不支持对`in_channels`参数的设置。
- `use_mixed_loss`参将在未来被弃用,因此不建议使用。
- 不同的子类支持与模型相关的输入参数,详情请参考[模型定义](https://github.com/PaddlePaddle/PaddleRS/blob/develop/paddlers/rs_models/seg)和[训练器定义](https://github.com/PaddlePaddle/PaddleRS/blob/develop/paddlers/tasks/segmentor.py)。

@ -822,7 +822,7 @@ class DeepLabV3P(BaseSegmenter):
if params.get('with_net', True):
with DisablePrint():
backbone = getattr(ppseg.models, backbone)(
input_channel=input_channel, output_stride=output_stride)
input_channel=in_channels, output_stride=output_stride)
else:
backbone = None
params.update({

@ -7,5 +7,5 @@ save_dir: ./test_tipc/output/seg/unet/
model: !Node
type: UNet
args:
input_channel: 10
in_channels: 10
num_classes: 5

@ -129,10 +129,12 @@ def allow_oom(cls):
def _wrapper(self, *args, **kwargs):
try:
func(self, *args, **kwargs)
except (SystemError, RuntimeError, OSError) as e:
except (SystemError, RuntimeError, OSError, MemoryError) as e:
# XXX: This may not cover all OOM cases.
msg = str(e)
if "Out of memory error" in msg \
or "(External) CUDNN error(4), CUDNN_STATUS_INTERNAL_ERROR." in msg:
or "(External) CUDNN error(4), CUDNN_STATUS_INTERNAL_ERROR." in msg \
or isinstance(e, MemoryError):
logging.warning("An OOM error has been ignored.")
else:
raise

@ -26,6 +26,13 @@ pip install -r requirements.txt --ignore-installed
pip install -e .
pip install https://versaweb.dl.sourceforge.net/project/gdal-wheels-for-linux/GDAL-3.4.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
git clone https://github.com/LDOUBLEV/AutoLog
cd AutoLog
pip install -r requirements.txt
python setup.py bdist_wheel
pip install ./dist/auto_log*.whl
cd ..
unset http_proxy https_proxy
set -e

@ -0,0 +1,13 @@
#!/usr/bin/env bash
cd ..
for config in $(ls test_tipc/configs/*/*/train_infer_python.txt); do
bash test_tipc/prepare.sh ${config} lite_train_lite_infer
bash test_tipc/test_train_inference_python.sh ${config} lite_train_lite_infer
task="$(basename $(dirname $(dirname ${config})))"
model="$(basename $(dirname ${config}))"
if grep -q 'failed' "test_tipc/output/${task}/${model}/lite_train_lite_infer/results_python.log"; then
exit 1
fi
done
Loading…
Cancel
Save