文件最后提交记录最后更新时间
init 4 年前
init 4 年前
init 4 年前
!4685 [fix] 修改算子调用方式 * fix code clean all_py about Operator modification * fix code clean * fix op way first 2 年前
init 4 年前
init 4 年前
init 4 年前
!4671 【fix】批量修改模型python版本,兼容环境上的python3.8版本 * fix python version 3 年前
init 4 年前
!3130 [自研][PyTorch]Bugfix:修复MaskRCNN和CascadedMaskRCNN在B020版本二进制使能下功能报错 !3130 [自研][PyTorch]Bugfix:修复MaskRCNN和CascadedMaskRCNN在B020版本二进制使能下功能报错 3 年前
init 4 年前
init 4 年前
!5255 【Pytorch】wideResNet101/wideResNet50/Xception/Cascade_Rcnn/CascadedMaskRCNN/CenterFace模型--公网地址整改 * url fixed * url fixed 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 个月前
[众智][PyTorch]整改模型中的requirements.txt文件,删除torch,apex Signed-off-by: bailang <bailang12@h-partners.com> 3 年前
init 4 年前
init 4 年前
README.md

CascadedMaskRCNN

本项目实现了 CascadedMaskRCNN 在 NPU 上的训练, 迁移自 detectron2-0.2.1. detectron2 github链接

CascadedMaskRCNN Detail

本项目对 detectron2-0.2.1 做了如下更改:

  1. 迁移到 NPU 上
  2. 使用混合精度训练、测试
  3. 对于一些操作,固定动态 shape 、使用 NPU 算子优化性能、同时将一些操作转移到 CPU 上进行

Requirements

  • NPU 配套的 run 包安装(20211018)
  • Python 3.7.5
  • PyTorch(NPU20210930 版本)
  • apex(NPU20210930 版本)
  • torchvision 0.6.0
  • decorator
  • sympy
  • 安装 detectron2
conda create -n cascaded-mask python=3.7.5
conda activate cascaded-mask
pip install torch-1.5.0+ascend.post3.20210930-cp37-cp37m-linux_x86_64.whl
pip install apex-0.1+ascend.20210930-cp37-cp37m-linux_x86_64.whl
pip install -r CascadedMaskRCNN/requirements.txt
source CascadedMaskRCNN/test/env_npu.sh
python -m pip install -e CascadedMaskRCNN
  • 下载 COCO 数据集,放在 datasets 中。如已有下载可通过设置环境变量DETECTRON2_DATASETS=“coco 所在数据集路径”进行设置,如 export DETECTRON2_DATASETS=/opt/npu/,则 coco 数据集放在 /opt/npu/ 目录中
  • 下载预训练模型 R-50.pkl ,configs/Misc/cascade_mask_rcnn_R_50_FPN_1x.yaml配置文件中MODEL.WEIGHTS 设置为R-50.pkl的绝对路径

Training

cd CascadedMaskRCNN
conda activate cascaded-mask

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

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

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

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

#test 8p accuracy
bash test/train_eval_8p.sh --data_path=/opt/npu/ --pth_path=./output/model_final.pth

# finetuning 1p
bash test/train_finetune_1p.sh --data_path=/opt/npu/ --pth_path=./output/model_final.pth

Log path: test/output/devie_id/train_device_id.log # training detail log test/output/devie_id/CascadedMaskRCNN_bs128_8p_perf.log # 8p training performance result log test/output/devie_id/CascadedMaskRCNN_bs128_8p_acc.log # 8p training accuracy result log

CascadedMaskRCNN training result

Acc@1 FPS Npu_nums Epochs AMP_Type
- 3 1 12.17 O2
36.255 25 8 24.34 O2

公网地址说明

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