文件最后提交记录最后更新时间
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 个月前
!6338 [PyTorch][built-in][SurroundOcc]Add source code of SurroundOcc Merge pull request !6338 from liuqiyuan/master 1 年前
!6352 [build-in][PyTorch][SurroundOcc] Adapt SurroundOcc to Ascend NPU Merge pull request !6352 from liuqiyuan/master 1 年前
!6720 更新mx_driving算子调用方法 Merge pull request !6720 from 李林斯曼/master 1 年前
!6419 [PyTorch][built-in][SurroundOcc] Modify script name Merge pull request !6419 from liuqiyuan/master 1 年前
!6352 [build-in][PyTorch][SurroundOcc] Adapt SurroundOcc to Ascend NPU Merge pull request !6352 from liuqiyuan/master 1 年前
!6338 [PyTorch][built-in][SurroundOcc]Add source code of SurroundOcc Merge pull request !6338 from liuqiyuan/master 1 年前
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 个月前
!7376 optimize public_address_statement.md Merge pull request !7376 from 王凯宇/master 8 个月前
!6352 [build-in][PyTorch][SurroundOcc] Adapt SurroundOcc to Ascend NPU Merge pull request !6352 from liuqiyuan/master 1 年前
!6352 [build-in][PyTorch][SurroundOcc] Adapt SurroundOcc to Ascend NPU Merge pull request !6352 from liuqiyuan/master 1 年前
README.md

当前仓已不维护,请跳转至 https://gitcode.com/ascend/DrivingSDK/tree/master/model_examples/SurroundOcc

SurroundOcc for PyTorch

目录

简介

模型介绍

传统的 3D 场景理解方法大多数都集中在 3D 目标检测上,难以描述任意形状和无限类别的真实世界物体。而 SurroundOcc 方法可以更全面地感知 3D 场景。首先对每个图像提取多尺度特征,并采用空间 2D-3D 注意力将其提升到 3D 体积空间;然后,采用 3D 卷积逐步上采样体积特征,并在多个级别上施加监督。

支持任务列表

本仓已经支持以下模型任务类型

模型 任务列表 是否支持
SurroundOcc 训练

代码实现

  • 参考实现:

    url=https://github.com/weiyithu/SurroundOcc
    commit_id=f698d7968a60815067601776dabfca2a8b03500a
    
  • 适配昇腾 AI 处理器的实现:

    url=https://gitcode.com/ascend/ModelZoo-PyTorch.git
    code_path=PyTorch/built-in/autonoumous_driving 
    

SurroundOcc

准备训练环境

  • 推荐参考配套资源文档使用最新的配套版本。

    表 1 版本配套表

    软件 版本 安装指南
    Driver AscendHDK 24.1.RC3 驱动固件安装指南
    Firmware AscendHDK 24.1.RC3
    CANN CANN 8.0.RC3 CANN 软件安装指南
    PyTorch 2.1.0 Ascend Extension for PyTorch 配置与安装
    torch_npu release v6.0.rc3
  • 环境准备指导。

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

  • 安装mmdet3d

    • 在模型根目录下,克隆mmdet3d仓,并进入mmdetection3d目录

      git clone -b v1.0.0rc4 https://github.com/open-mmlab/mmdetection3d.git
      cd mmdetection3d
      
    • 在mmdetection3d目录下,修改代码

      (1)删除requirements/runtime.txt中第3行 numba==0.53.0

      (2)修改mmdet3d/init.py中第22行 mmcv_maximum_version = '1.7.0'为mmcv_maximum_version = '1.7.2'

    • 安装包

      pip install -v -e .
      
  • 安装mmcv

    • 在模型根目录下,克隆mmcv仓,并进入mmcv目录安装

      git clone -b 1.x https://github.com/open-mmlab/mmcv
      cd mmcv
      MMCV_WITH_OPS=1 pip install -e . -v
      
  • 安装mx_driving

    • 参考mxDriving官方gitcode仓README安装编译构建并安装mxDriving包:参考链接 【注意】当前版本配套mxDriving RC3及以上版本,历史mxDriving版本需要model仓代码回退到git reset --hard 91ac141ecfe5872f4835eef6aa4662f46ede80c3
  • 在模型根目录下执行以下命令,安装模型对应PyTorch版本需要的依赖。

    pip install -r requirements.txt
    
  • 在当前python环境下执行'pip show pip',得到三方包安装路径Location,记作location_path,在模型根目录下执行以下命令来替换patch。

    bash replace_patch.sh --packages_path=location_path
    
  • 安装mxDriving加速库,安装方法参考原仓,安装后手动source环境变量或将其配置在test/env_npu.sh中。

准备数据集

  • 根据原仓Prepare Dataset章节准备数据集,数据集目录及结构如下:
SurroundOcc
├── data/
│   ├── nuscenes/
│   ├── nuscenes_occ/
│   ├── nuscenes_infos_train.pkl
│   ├── nuscenes_infos_val.pkl

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

准备预训练权重

  • 根据原仓Installation章节下载预训练权重r101_dcn_fcos3d_pretrain.pth,并放在模型根目录ckpts下。

快速开始

训练任务

本任务主要提供单机8卡训练脚本。

开始训练

  1. 在模型根目录下,运行训练脚本。

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

    • 单机8卡精度训练
    bash test/train_8p.sh
    
    • 单机8卡性能训练
    bash test/train_8p_performance.sh
    

训练结果

芯片 卡数 global batch size Precision epoch IoU mIoU 性能-单步迭代耗时(ms)
竞品A 8p 8 fp32 12 0.3163 0.1999 1028
Atlas 800T A2 8p 8 fp32 12 0.3169 0.1985 1654

公网地址说明

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

变更说明

2024.05.30:首次发布。

FAQ