PaddleClas/tests
dongshuilong 31f3ed7fde fix autolog warmup bug for whole train lite_train_infer mode 2021-10-18 10:18:43 +00:00
..
config update ResNet50_vd.txt for whole chain infer mode 2021-10-18 08:39:27 +00:00
README.md kl_quant for whole_chain and add readme 2021-09-29 04:26:51 +00:00
prepare.sh fix autolog warmup bug for whole train lite_train_infer mode 2021-10-18 10:18:43 +00:00
test.sh add lite model for whole chain 2021-10-12 03:45:59 +00:00

README.md

从训练到推理部署工具链测试方法介绍

test.sh和config文件夹下的txt文件配合使用完成Clas模型从训练到预测的流程测试。

安装依赖

  • 安装PaddlePaddle >= 2.0
  • 安装PaddleClass依赖
    pip3 install  -r ../requirements.txt
    
  • 安装autolog
    git clone https://github.com/LDOUBLEV/AutoLog
    cd AutoLog
    pip3 install -r requirements.txt
    python3 setup.py bdist_wheel
    pip3 install ./dist/auto_log-1.0.0-py3-none-any.whl
    cd ../
    

目录介绍

tests/
├── config                        # 测试模型的参数配置文件
|   |--- *.txt
└── prepare.sh                    # 完成test.sh运行所需要的数据和模型下载
└── test.sh                       # 测试主程序

使用方法

test.sh包四种运行模式每种模式的运行数据不同分别用于测试速度和精度分别是

  • 模式1lite_train_infer使用少量数据训练用于快速验证训练到预测的走通流程不验证精度和速度
bash tests/prepare.sh ./tests/config/ResNet50_vd.txt 'lite_train_infer'
bash tests/test.sh ./tests/config/ResNet50_vd.txt 'lite_train_infer'
  • 模式2whole_infer使用少量数据训练一定量数据预测用于验证训练后的模型执行预测预测速度是否合理
bash tests/prepare.sh ./tests/config/ResNet50_vd.txt 'whole_infer'
bash tests/test.sh ./tests/config/ResNet50_vd.txt 'whole_infer'
  • 模式3infer 不训练全量数据预测走通开源模型评估、动转静检查inference model预测时间和精度;
bash tests/prepare.sh ./tests/config/ResNet50_vd.txt 'infer'
# 用法1:
bash tests/test.sh ./tests/config/ResNet50_vd.txt 'infer'

需注意的是,模型的离线量化需使用infer模式进行测试

  • 模式4whole_train_infer , CE 全量数据训练,全量数据预测,验证模型训练精度,预测精度,预测速度;
bash tests/prepare.sh ./tests/config/ResNet50_vd.txt 'whole_train_infer'
bash tests/test.sh ./tests/config/ResNet50_vd.txt 'whole_train_infer'
  • 模式5cpp_infer , CE 验证inference model的c++预测是否走通;
bash tests/prepare.sh ./tests/config/ResNet50_vd.txt 'cpp_infer'
bash tests/test.sh ./tests/config/ResNet50_vd.txt 'cpp_infer'

日志输出

最终在tests/output目录下生成.log后缀的日志文件