文件最后提交记录最后更新时间
init 4 年前
init 4 年前
init 4 年前
[pytorch]pytorch 1.11 官方接口torch.distributed.destroy_process_group()接口会导致训练结束进程阻塞,需要删除,待pytorch1.11官方版本解决该问题后再添加使用 3 年前
!4671 【fix】批量修改模型python版本,兼容环境上的python3.8版本 * fix python version 3 年前
!1766 [西安交通大学][高校贡献][Pytorch迁移1.8][EfficientNet-B3]初次提交 !1766 [西安交通大学][高校贡献][Pytorch迁移1.8][EfficientNet-B3]初次提交 3 年前
readme整改 3 年前
readme整改 3 年前
init 4 年前
!4671 【fix】批量修改模型python版本,兼容环境上的python3.8版本 * fix python version 3 年前
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 个月前
!5175 【pytorch】【contrib】【cv】 模型公网地址整改 * 【pytorch】【contrib】【cv】DPN-131_for_PyTorch/DnCNN/EfficientNet-B1/Effici… 2 年前
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 年前
!5175 【pytorch】【contrib】【cv】 模型公网地址整改 * 【pytorch】【contrib】【cv】DPN-131_for_PyTorch/DnCNN/EfficientNet-B1/Effici… 2 年前
README.md

EfficientNet-B3 for PyTorch

概述

简述

EfficientNet-B3是一个新的卷积网络家族,与之前的模型相比,具有更快的训练速度和更好的参数效率。该模型通过一组固定的缩放系数统一缩放,这在网络深度,网络宽带,分辨率这三方面有明显优势。在 EfficientNet 中,这些特性是按更有原则的方式扩展的,也就是说,一切都是逐渐增加的。

  • 参考实现:

    url=https://github.com/facebookresearch/pycls
    commit_id=ee89cecb0e295b8037843e7e28344b156a847554
    
  • 适配昇腾 AI 处理器的实现:

    url=https://gitcode.com/ascend/ModelZoo-PyTorch.git
    code_path=PyTorch/contrib/cv/classification
    

准备训练环境

该模型为不随版本演进模型(随版本演进模型范围可在此处查看),未在最新昇腾配套软件中适配验证,您可以:

  1. 根据下面提供PyTorch版本在软件版本配套表中选择匹配的CANN等软件下载使用。
  2. 查看软件版本配套表后确认对该模型有新版本PyTorch和CANN中的适配需求,请在modelzoo/issues中提出您的需求。自行适配不保证精度和性能达标。

准备环境

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

    表 1 版本支持表

    Torch_Version 三方库依赖版本
    PyTorch 1.5 torchvision==0.2.2.post3;pillow==8.4.0
    PyTorch 1.8 torchvision==0.9.1;pillow==9.1.0
  • 环境准备指导。

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

  • 安装依赖。

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

    pip install -r 1.5_requirements.txt  # PyTorch1.5版本
    
    pip install -r 1.8_requirements.txt  # PyTorch1.8版本
    

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

准备数据集

  1. 获取数据集。

    用户自行获取原始数据集 imagenet ,将数据集上传到服务器并解压。

    数据集目录结构参考如下所示:

    ├──ImageNet
       ├──train
            ├──类别1
                  │──图片1
                  │──图片2
                  │   ...       
            ├──类别2
                  │──图片1
                  │──图片2
                  │   ...   
            ├──...                     
       ├──val  
            ├──类别1
                  │──图片1
                  │──图片2
                  │   ...       
            ├──类别2
                  │──图片1
                  │──图片2
                  │   ...    
    

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

  2. 数据预处理。

    pycls/datasets/loader.py 中修改数据集的路径,将变量 _DATA_DIR 修改为 imagenet 数据集的路径。

开始训练

训练模型

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

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

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

    • 单机单卡训练

      启动单卡训练。

      bash ./test/train_full_1p.sh --data_path=/data/xxx/  # 单卡精度
      
      bash ./test/train_performance_1p.sh --data_path=/data/xxx/  # 单卡性能
      
    • 单机8卡训练

      启动8卡训练。

      bash ./test/train_full_8p.sh --data_path=/data/xxx/  # 8卡精度
      
      bash ./test/train_performance_8p.sh --data_path=/data/xxx/  # 8卡性能
      
    • 单机8卡评测

      启动8卡评测。

      bash ./test/train_eval_8p.sh --data_path=/data/xxx/ --pth_path=real_pre_train_model_path # 8卡评测
      

    --data_path参数填写数据集路径,需写到数据集的一级目录。

    --pth_path参数填写训练权重生成路径,需写到权重文件的一级目录。

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

    公共参数:
    --device                            //使用设备,gpu或npu
    --cfg                               //使用yaml配置文件路径
    --rank_id                           //默认卡号
    --device_id                         //默认设备号
    

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

训练结果展示

表 2 训练结果展示表

NAME Acc@1 FPS Epochs AMP_Type Torch_Version
1p-竞品V - - 1 - 1.5
8p-竞品V - - 100 - 1.5
1p-NPU - 356 1 O2 1.8
8p-NPU 77.0613 2236 100 O2 1.8

版本说明

2022.08.01:更新pytorch1.8版本,重新发布。

FAQ

无。

公网地址说明

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