文件最后提交记录最后更新时间
init 4 年前
!4685 [fix] 修改算子调用方式 * fix code clean all_py about Operator modification * fix code clean * fix op way first 2 年前
!4685 [fix] 修改算子调用方式 * fix code clean all_py about Operator modification * fix code clean * fix op way first 2 年前
!4671 【fix】批量修改模型python版本,兼容环境上的python3.8版本 * fix python version 3 年前
!5805 Network address of models to be rectified: 21 Merge pull request !5805 from Yss/network_declaration_21 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 个月前
[众智][PyTorch]整改模型中的requirements.txt文件,删除torch,apex Signed-off-by: bailang <bailang12@h-partners.com> 3 年前
init 4 年前
init 4 年前
README.md

SlowFast

SlowFast 模型在 Kinetics400 数据集上的实现,主要修改自 open-mmlab/mmaction2 源码

环境准备

  • 安装 Pytorch 和混合精度训练工具 Apex
  • 安装依赖 pip install -r requirements.txt
  • 下载 kinetics400 数据集

注:有关依赖中的 decord,若在 x86 平台上,可以直接通过 pip install decord 进行安装,若在 ARM Linux 平台上,则需通过源码编译安装,具体参见 dmlc/decord

安装 MMCV

下载 mmcv 源码

git clone -b v1.3.9 https://github.com/open-mmlab/mmcv.git
mv mmcv/ mmcv-master/
mv mmcv-master/mmcv ./
rm -rf mmcv-master/

替换 mmcv 中的文件

/bin/cp -f mmcv_need/base_runner.py mmcv/runner/base_runner.py
/bin/cp -f mmcv_need/builder.py mmcv/runner/optimizer/builder.py
/bin/cp -f mmcv_need/checkpoint.py mmcv/runner/hooks/checkpoint.py
/bin/cp -f mmcv_need/data_parallel.py mmcv/parallel/data_parallel.py
/bin/cp -f mmcv_need/dist_utils.py mmcv/runner/dist_utils.py
/bin/cp -f mmcv_need/distributed.py mmcv/parallel/distributed.py
/bin/cp -f mmcv_need/epoch_based_runner.py mmcv/runner/epoch_based_runner.py
/bin/cp -f mmcv_need/iter_timer.py mmcv/runner/hooks/iter_timer.py
/bin/cp -f mmcv_need/optimizer.py mmcv/runner/hooks/optimizer.py
/bin/cp -f mmcv_need/test.py mmcv/engine/test.py
/bin/cp -f mmcv_need/transformer.py mmcv/cnn/bricks/transformer.py

训练

训练阶段,脚本调用 train.py 进行训练

# 1p train perf
bash test/train_performance_1p.sh --data_path=/opt/npu

# 8p train perf
bash test/train_performance_8p.sh --data_path=/opt/npu

# 8p train full
bash test/train_full_8p.sh --data_path=/opt/npu

# 8p eval 
bash test/train_eval_8p.sh --data_path=/opt/npu

# finetuning
bash test/train_finetune_1p.sh --data_path=/opt/npu

注: 可以通过修改 --data_path 来指定数据集文件夹的位置,例如,你的数据集地址为:/opt/npu/kinetics400, 可设置 --data_path=/opt/npu

Log Path:

  • slowfast_performance_1p.log # 1p 训练下性能测试日志
  • slowfast_performance_8p.log # 8p 训练下性能测试日志
  • slowfast_full_1p.log # 1p 完整训练下性能和精度测试日志
  • slowfast_full_8p.log # 8p 完整训练下性能和精度测试日志
  • slowfast_eval_8p.log # 8p 测试模型验证集精度日志
  • slowfast_finetune_1p.log # 1p 下 fine-tuning 日志

TSM-NonLocal 训练结果

top1 acc (单view) FPS Epochs AMP_Type Device
- 11 1 O1 1p Npu
33.43 (30 epochs) 81 256 O1 8p Npu
- 14 1 O1 1p Gpu
30.24 (30 epochs) 86 256 O1 8p Gpu

注:源仓库模型单 view 测试为 70.19 (256 epochs),30 views 测试为 77.0(256 epochs)

公网地址说明

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