文件最后提交记录最后更新时间
init 4 年前
init 4 年前
init 4 年前
init 4 年前
init 4 年前
!4170 【自研】【pytorch模型】bugfix: 修复mmcv相关模型apex与torch融合优化器命名冲突 * fix conflicts of fused optimizers in torch_npu and apex 3 年前
!4685 [fix] 修改算子调用方式 * fix code clean all_py about Operator modification * fix code clean * fix op way first 2 年前
init 4 年前
!4671 【fix】批量修改模型python版本,兼容环境上的python3.8版本 * fix python version 3 年前
init 4 年前
!4671 【fix】批量修改模型python版本,兼容环境上的python3.8版本 * fix python version 3 年前
init 4 年前
init 4 年前
init 4 年前
init 4 年前
!5192 GCNet、GFocalV2、M2Det、NasFPN、RCF 模型公网地址整改 * GCNet、GFocalV2、M2Det、NasFPN、RCF 模型公网地址整改 2 年前
fix link validity Co-authored-by: frozenleaves<914814442@qq.com> # message auto-generated for no-merge-commit merge: !7517 merge master into master fix link validity Created-by: frozenn Commit-by: frozenleaves Merged-by: ascend-robot Description: ## Motivation Please describe the motivation of this PR and the goal you want to achieve through this PR. ## Modification Please briefly describe what modification is made in this PR. ## Self-test (Optional) If modifications to this PR may cause/fix function/accuracy/performance DTSs/issues, a self-inspection record needs to be attached. ## BC-breaking (Optional) If there are compatibility issues, such as dependencies on cann/torch_npu versions, they need to be explained in the PR. ## Checklist **Before PR**: - [ ] The new code needs to comply with the Clean Code specification. - [ ] The PR content is self-checked, and the expression can be clear and the writing standardized **After PR**: - [ ] CLA has been signed and all committers have signed the CLA in this PR. - [ ] The ci-pipeline is passed, Code Check is passed. See merge request: Ascend/ModelZoo-PyTorch!75171 个月前
init 4 年前
!7376 optimize public_address_statement.md Merge pull request !7376 from 王凯宇/master 8 个月前
init 4 年前
init 4 年前
init 4 年前
init 4 年前
README.md

NasFPN

本项目实现了NasFPN 在 NPU 上的训练, 迁移自 mmdetection-2.11.0. mmdetection github链接

NasFPN Detail

本项目对 mmdetection-2.11.0 做了如下更改:

  1. 迁移到 NPU 上
  2. 使用混合精度训练
  3. 对于一些操作使用 NPU 算子优化性能

Requirements

  • NPU 配套的 run 包安装(20211018)
  • Python 3.7.5
  • PyTorch(NPU20210930 版本)
  • apex(NPU20210930 版本)
  • torchvision 0.6.0
  • decorator
  • sympy
  • opencv-python
  • 准备coco2017数据集

Install

# 安装mmcv
cd NasFPN
cd ../
git clone -b v1.2.6 --depth=1 https://github.com/open-mmlab/mmcv.git
export MMCV_WITH_OPS=1
export MAX_JOBS=8
source NasFPN/test/env_npu.sh
cd mmcv
python3 setup.py build_ext
python3 setup.py develop
pip3 list | grep mmcv

# 安装mmdetection
cd ../NasFPN
pip3 install -r requirements/build.txt
pip3 install -v -e .
pip3 list | grep mm

# 替换mmcv中的部分文件
cp -f mmcv_need/_functions.py ../mmcv/mmcv/parallel/
cp -f mmcv_need/builder.py ../mmcv/mmcv/runner/optimizer/
cp -f mmcv_need/data_parallel.py ../mmcv/mmcv/parallel/
cp -f mmcv_need/dist_utils.py ../mmcv/mmcv/runner/
cp -f mmcv_need/distributed.py ../mmcv/mmcv/parallel/
cp -f mmcv_need/optimizer.py ../mmcv/mmcv/runner/hooks/
cp -f mmcv_need/text.py ../mmcv/mmcv/runner/hooks/logger/
cp -f mmcv_need/epoch_based_runner.py ../mmcv/mmcv/runner/

Training

cd NasFPN

# training 1p accuracy
bash ./test/train_full_1p.sh --data_path=/opt/npu/coco

# training 1p performance
bash ./test/train_performance_1p.sh --data_path=/opt/npu/coco

# training 8p accuracy
bash ./test/train_full_8p.sh --data_path=/opt/npu/coco

# training 8p performance
bash ./test/train_performance_8p.sh --data_path=/opt/npu/c0c0

#test 8p accuracy
bash test/train_eval_8p.sh --data_path=/opt/npu/coco --pth_path=work_dirs/retinanet_r50_nasfpn_crop640_50e_coco/latest.pth

# finetuning 1p
bash test/train_finetune_1p.sh --data_path=/opt/npu/coco --pth_path=work_dirs/retinanet_r50_nasfpn_crop640_50e_coco/latest.pth

Log path: test/output/${device_id}/train_${device_id}.log # training detail log test/output/${device_id}/NasFPN_bs192_8p_perf.log # 8p training performance result log test/output/${device_id}/NasFPN_bs192_8p_acc.log # 8p training accuracy result log

CascadedMaskRCNN training result

Acc@1 FPS Npu_nums Epochs AMP_Type
- 18.7 1 50 O1
40.4 109.5 8 50 O1

公网地址说明

代码涉及公网地址参考 public_address_statement.md