文件最后提交记录最后更新时间
!4704 [fix] 处理PT2.0版本上mmcv适配问题 * fix readme 2 年前
!2967 【PyTorch】【built-in】【MobileNetV2_for_PyTorch】动态shape网络批量适配CompileTime; !2967 【PyTorch】【built-in】【MobileNetV2_for_PyTorch】动态shape网络批量适配CompileTime; 3 年前
init 4 年前
init 4 年前
init 4 年前
!3427 [自研][Pytorch]C3D、FCOS固定三方库依赖版本 * C3D、FCOS固定三方库依赖版本 3 年前
update PyTorch/contrib/cv/video/C3D/test/train_ID4116_C3D_RT2_performance_1p.sh. 修改网络conda设置 Signed-off-by: 石莉 <2020857336@qq.com>2 年前
!4704 [fix] 处理PT2.0版本上mmcv适配问题 * fix readme 2 年前
!5620 【Pytorch】批量模型更新Readme版本支持表 Merge pull request !5620 from chenping68/readme_flush 2 年前
!5620 【Pytorch】批量模型更新Readme版本支持表 Merge pull request !5620 from chenping68/readme_flush 2 年前
!6074 PyTorch 2.2 版本依赖配套更新 Merge pull request !6074 from Chai/master 2 年前
!6349 PyTorch 2.3 版本依赖配套更新 Merge pull request !6349 from 周嘉益/master 1 年前
!6574 PyTorch 2.4 版本依赖配套更新 Merge pull request !6574 from 周嘉益/pt24 1 年前
init 4 年前
init 4 年前
init 4 年前
文档整改,gitee->gitcode Co-authored-by: Lighters_c<zyh13227@163.com> # message auto-generated for no-merge-commit merge: !7469 merge ffffix into master 文档整改,gitee->gitcode Created-by: addsubmuldiv Commit-by: Lighters_c 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!74695 个月前
init 4 年前
init 4 年前
init 4 年前
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 年前
!3460 [自研][pytorch][c3d]删除c3d的maxpool3d黑名单 * delete maxpool3d blacklist 3 年前
README.md

C3D for PyTorch

概述

简述

C3D模型使用经过大规模视频数据集预训练的3D ConvNets来学习视频的时空特征,可以同时对外观和运动信息进行建模,在各种视频分析任务上,证明了其采用的3D ConvNets优于2D ConvNet特征,是一个经典的视频时空特征提取backbone网络。

  • 参考实现:

    url=https://github.com/open-mmlab/mmaction2/blob/master/configs/recognition/c3d/README.md
    commit_id=2b6f9ac69b3609b96a514501ffe30fc90545f518
    
  • 适配昇腾 AI 处理器的实现:

    url=https://gitcode.com/ascend/ModelZoo-PyTorch.git
    code_path=PyTorch/contrib/cv/video
    
  • 通过单击“立即下载”,下载源码包。

准备训练环境

准备环境

  • 当前模型支持的 PyTorch 版本和已知三方库依赖如下表所示。

    表 1 版本支持表

    Torch_Version 三方库依赖版本
    PyTorch 1.11 torchvision==0.12.0
    PyTorch 2.1 torchvision==0.16.0
    PyTorch 2.2 torchvision==0.17.0
    PyTorch 2.3 torchvision==0.18.1
    PyTorch 2.4 torchvision==0.19.0
  • 环境准备指导。

    请参考《Pytorch框架训练环境准备》。

  • 安装依赖。

    在模型源码包根目录下执行命令,安装模型对应PyTorch版本需要的依赖。

    pip install -r 1.11_requirements.txt  # PyTorch1.11版本
    
    pip install -r 2.1_requirements.txt  # PyTorch2.1版本
    
    pip install -r 2.2_requirements.txt  # PyTorch2.2版本
    
    pip install -r 2.3_requirements.txt  # PyTorch2.3版本
    
    pip install -r 2.4_requirements.txt  # PyTorch2.4版本
    

    说明: 只需执行一条对应的PyTorch版本依赖安装命令。

  • 安装 mmcv(在模型源码包根目录下执行以下操作)。

    export GIT_SSL_NO_VERIFY=1
    git config --global http.sslVerify false
    git clone -b v1.3.9 --depth=1 https://github.com/open-mmlab/mmcv.git
    source ./test/env_npu.sh; cd mmcv; python3 setup.py build_ext; python3 setup.py develop
    
  • 修改mmcv。

    cp ./additional_need/mmcv/distributed.py  ./mmcv/mmcv/parallel/
    cp ./additional_need/mmcv/test.py  ./mmcv/mmcv/engine/
    cp ./additional_need/mmcv/dist_utils.py  ./mmcv/mmcv/runner/
    cp ./additional_need/mmcv/optimizer.py  ./mmcv/mmcv/runner/hooks/
    cp ./additional_need/mmcv/epoch_based_runner.py ./mmcv/mmcv/runner/
    

准备数据集

  1. 获取数据集。

    用户自行获取原始数据集,可选用的开源数据集包括ucf101等,将获取好的数据集上传至在源码包根目录下新建的"data/"文件夹下并解压。

    以ucf101数据集为例,数据集目录结构参考如下所示。

    data
    ├── ucf101
    │   ├── ucf101_{train,val}_split_{1,2,3}_rawframes.txt
    │   ├── ucf101_{train,val}_split_{1,2,3}_videos.txt
    │   ├── annotations
    │   ├── rawframes
    │   │   ├── ApplyEyeMakeup
    │   │   │   ├── v_ApplyEyeMakeup_g01_c01
    │   │   │   │   ├── img_00001.jpg
    │   │   │   │   ├── img_00002.jpg
    │   │   │   │   ├── ...
    │   │   │   │   ├── flow_x_00001.jpg
    │   │   │   │   ├── flow_x_00002.jpg
    │   │   │   │   ├── ...
    │   │   │   │   ├── flow_y_00001.jpg
    │   │   │   │   ├── flow_y_00002.jpg
    │   │   ├── ...
    │   │   ├── YoYo
    │   │   │   ├── v_YoYo_g01_c01
    │   │   │   ├── ...
    │   │   │   ├── v_YoYo_g25_c05
    

    说明: 该数据集的训练过程脚本只作为一种参考示例。

开始训练

训练模型

  1. 进入解压后的源码包根目录。

    cd /${模型文件夹名称} 
    
  2. 运行训练脚本。

    该模型支持单机单卡训练和单机8卡训练。

    • 单机单卡训练

      启动单卡训练。

      bash ./test/train_performance_1p.sh  #单卡性能
      
      bash ./test/train_full_1p.sh  #单卡精度
      
      bash ./test/test_1p.sh  #单卡精度测试
      
    • 单机8卡训练

      启动8卡训练。

      bash ./test/train_performance_8p.sh  #8卡性能
      
      bash ./test/train_full_8p.sh  #8卡精度
      
      bash ./test/test_8p.sh  #8卡精度测试
      

    模型训练脚本参数说明如下。

    公共参数:
    --data_path                         //数据集路径
    --batch_size                        //训练批次大小
    --validate                          //启动验证
    --rank_id                           //训练卡id
    --seed                              //种子设定
    

    训练完成后,权重文件保存在当前路径下,并在test/output中输出模型训练精度和性能信息。

训练结果展示

表 2 训练结果展示表

NAME Acc@1 FPS Epochs AMP_Type Torch_version
1p-竞品V - - - - -
8p-竞品V - - - - -
1p-NPU - 58.93 1 O2 1.8
8p-NPU 81.42 443.83 30 O2 1.8

版本说明

变更

2023.02.13:更新readme,重新发布。

2021.02.14:首次发布。

FAQ

无。

公网地址说明

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