文件最后提交记录最后更新时间
fix:fix code/documentation formatting issues using pre-commit Co-authored-by: xiaohuizhu1037<zhuxiaohui13@huawei.com> # message auto-generated for no-merge-commit merge: !2043 merge master into master fix:fix code/documentation formatting issues using pre-commit Created-by: xiaohuizhu1037 Commit-by: xiaohuizhu1037 Merged-by: ascend-robot Description: ## What this PR does / why we need it? 使用pre-commit扫描仓库的全量代码/文档并进行格式修复。 ## Does this PR introduce any user-facing change? 会对代码/文档做格式修改。 ## How was this patch tested? 工具自动修复和人工审视。 See merge request: Ascend/DrivingSDK!20436 天前
add_model_driveragent Co-authored-by: 张乾乾<zhangqianqian46@huawei.com> # message auto-generated for no-merge-commit merge: !1909 merge add_driver_agent_model into master add_model_driveragent Created-by: zhang_qianqian46 Commit-by: 张乾乾 Merged-by: ascend-robot Description: ## 描述 <!--在这里详细描述你的改动,包括改动的原因和所采取的方法。--> 新增数据和模型双驱动驾驶员模型 ## 关联的Issue <!-- 如果这个PR是为了解决特定的Issue,请在这里提供Issue链接。例如:关联Issue #123--> <!-- 如果这个PR是为了解决特定的问题单,请在这里描述问题单单号。--> ## 测试 <!--描述进行了哪些测试来验证你的改动。包括但不限于二级冒烟、算子泛化等。--> ## 文档更新 <!--如果这个PR包含文档的更新,请在这里指出。例如:更新了README.md文件。--> ## 类型标签 <!-- [x] 表示选中 --> - [ ] Bug修复 - [x] 新特性 - [ ] 性能优化 - [ ] 文档更新 - [ ] 其他,请描述: See merge request: Ascend/DrivingSDK!19093 个月前
fix: fix driver_agent model precision Co-authored-by: 张乾乾<zhangqianqian46@huawei.com> # message auto-generated for no-merge-commit merge: !1922 merge fix_driver_agent into master fix: fix driver_agent model precision Created-by: zhang_qianqian46 Commit-by: 张乾乾 Merged-by: ascend-robot Description: ## What this PR does / why we need it? Please describe the background and detailed changes of the PR. If it is a bugfix, please attach the related issue. 1. 针对指数运算溢出问题,对torch.exp的输入值进行范围限制(收放在-10~10之间) 2. 针对除零及极小分母问题,在utils.py中对所有除法操作(含loss平均、attention归一化等)增加分母判断,若分母接近0,直接返回0或极小值,避免执行无效除法引发nan 3. 在model.py中对激活值、特征、注意力分数等关键张量添加clamp范围约束,及时截断NaN、inf等异常值,同时在注意力模块中合理限制注意力分值,采用安全大负数替代负无穷(-inf) 4. 针对训练过程梯度及混合精度问题,在train.py中采用静态梯度,过程中限制梯度裁剪梯度过大,同时修改混合精度缩放策略,调整为更保守的参数 ## Does this PR introduce any user-facing change? Please describe whether the PR will result in any user-facing usage changes. If there is related documentation, please specify its path. ## How was this patch tested? Please explain how to verify the correctness and effectiveness of this feature, as well as its usage constraints and limitations. See merge request: Ascend/DrivingSDK!19222 个月前
fix: fix driver_agent model precision Co-authored-by: 张乾乾<zhangqianqian46@huawei.com> # message auto-generated for no-merge-commit merge: !1922 merge fix_driver_agent into master fix: fix driver_agent model precision Created-by: zhang_qianqian46 Commit-by: 张乾乾 Merged-by: ascend-robot Description: ## What this PR does / why we need it? Please describe the background and detailed changes of the PR. If it is a bugfix, please attach the related issue. 1. 针对指数运算溢出问题,对torch.exp的输入值进行范围限制(收放在-10~10之间) 2. 针对除零及极小分母问题,在utils.py中对所有除法操作(含loss平均、attention归一化等)增加分母判断,若分母接近0,直接返回0或极小值,避免执行无效除法引发nan 3. 在model.py中对激活值、特征、注意力分数等关键张量添加clamp范围约束,及时截断NaN、inf等异常值,同时在注意力模块中合理限制注意力分值,采用安全大负数替代负无穷(-inf) 4. 针对训练过程梯度及混合精度问题,在train.py中采用静态梯度,过程中限制梯度裁剪梯度过大,同时修改混合精度缩放策略,调整为更保守的参数 ## Does this PR introduce any user-facing change? Please describe whether the PR will result in any user-facing usage changes. If there is related documentation, please specify its path. ## How was this patch tested? Please explain how to verify the correctness and effectiveness of this feature, as well as its usage constraints and limitations. See merge request: Ascend/DrivingSDK!19222 个月前
fix:fix code/documentation formatting issues using pre-commit Co-authored-by: xiaohuizhu1037<zhuxiaohui13@huawei.com> # message auto-generated for no-merge-commit merge: !2043 merge master into master fix:fix code/documentation formatting issues using pre-commit Created-by: xiaohuizhu1037 Commit-by: xiaohuizhu1037 Merged-by: ascend-robot Description: ## What this PR does / why we need it? 使用pre-commit扫描仓库的全量代码/文档并进行格式修复。 ## Does this PR introduce any user-facing change? 会对代码/文档做格式修改。 ## How was this patch tested? 工具自动修复和人工审视。 See merge request: Ascend/DrivingSDK!20436 天前
fix: fix driver_agent model precision Co-authored-by: 张乾乾<zhangqianqian46@huawei.com> # message auto-generated for no-merge-commit merge: !1922 merge fix_driver_agent into master fix: fix driver_agent model precision Created-by: zhang_qianqian46 Commit-by: 张乾乾 Merged-by: ascend-robot Description: ## What this PR does / why we need it? Please describe the background and detailed changes of the PR. If it is a bugfix, please attach the related issue. 1. 针对指数运算溢出问题,对torch.exp的输入值进行范围限制(收放在-10~10之间) 2. 针对除零及极小分母问题,在utils.py中对所有除法操作(含loss平均、attention归一化等)增加分母判断,若分母接近0,直接返回0或极小值,避免执行无效除法引发nan 3. 在model.py中对激活值、特征、注意力分数等关键张量添加clamp范围约束,及时截断NaN、inf等异常值,同时在注意力模块中合理限制注意力分值,采用安全大负数替代负无穷(-inf) 4. 针对训练过程梯度及混合精度问题,在train.py中采用静态梯度,过程中限制梯度裁剪梯度过大,同时修改混合精度缩放策略,调整为更保守的参数 ## Does this PR introduce any user-facing change? Please describe whether the PR will result in any user-facing usage changes. If there is related documentation, please specify its path. ## How was this patch tested? Please explain how to verify the correctness and effectiveness of this feature, as well as its usage constraints and limitations. See merge request: Ascend/DrivingSDK!19222 个月前
fix:fix code/documentation formatting issues using pre-commit Co-authored-by: xiaohuizhu1037<zhuxiaohui13@huawei.com> # message auto-generated for no-merge-commit merge: !2043 merge master into master fix:fix code/documentation formatting issues using pre-commit Created-by: xiaohuizhu1037 Commit-by: xiaohuizhu1037 Merged-by: ascend-robot Description: ## What this PR does / why we need it? 使用pre-commit扫描仓库的全量代码/文档并进行格式修复。 ## Does this PR introduce any user-facing change? 会对代码/文档做格式修改。 ## How was this patch tested? 工具自动修复和人工审视。 See merge request: Ascend/DrivingSDK!20436 天前
fix: fix driver_agent model precision Co-authored-by: 张乾乾<zhangqianqian46@huawei.com> # message auto-generated for no-merge-commit merge: !1922 merge fix_driver_agent into master fix: fix driver_agent model precision Created-by: zhang_qianqian46 Commit-by: 张乾乾 Merged-by: ascend-robot Description: ## What this PR does / why we need it? Please describe the background and detailed changes of the PR. If it is a bugfix, please attach the related issue. 1. 针对指数运算溢出问题,对torch.exp的输入值进行范围限制(收放在-10~10之间) 2. 针对除零及极小分母问题,在utils.py中对所有除法操作(含loss平均、attention归一化等)增加分母判断,若分母接近0,直接返回0或极小值,避免执行无效除法引发nan 3. 在model.py中对激活值、特征、注意力分数等关键张量添加clamp范围约束,及时截断NaN、inf等异常值,同时在注意力模块中合理限制注意力分值,采用安全大负数替代负无穷(-inf) 4. 针对训练过程梯度及混合精度问题,在train.py中采用静态梯度,过程中限制梯度裁剪梯度过大,同时修改混合精度缩放策略,调整为更保守的参数 ## Does this PR introduce any user-facing change? Please describe whether the PR will result in any user-facing usage changes. If there is related documentation, please specify its path. ## How was this patch tested? Please explain how to verify the correctness and effectiveness of this feature, as well as its usage constraints and limitations. See merge request: Ascend/DrivingSDK!19222 个月前
README.md

DriverAgent

目录

简介

模型介绍

DriverAgent是一项针对自动驾驶车辆行为交互性与轨迹真实性的车辆驾驶行为代理模型,其核心目标是在多车交互场景下对周边车辆的驾驶行为与驾驶轨迹进行预测。该模型通过对海量广泛场景下真实驾驶行为数据进行训练,学习并模仿真实驾驶员的驾驶偏好,使得模型能够在广泛的场景下准确模拟司机的驾驶行为与驾驶轨迹。同时,为学习不同驾驶员行为的多样性,该模型调整后支持输出多模态轨迹与对应模态的概率。基于真实驾驶行为数据进行实验表明,该模型在轨迹预测准确性(MSE/RMSE/MAPE等指标)上超越了SOTA模型,即使是在高频交互场景下该模型预测也保持较高的准确性。使用该行为代理模型,在自动驾驶领域,可以用于对周边车辆的行为推断从而更好地支持自动驾驶决策。

代码实现

  • 适配昇腾 AI 处理器的实现:

    url=https://gitcode.com/Ascend/DrivingSDK.git
    code_path=model_examples/DriverAgent
    

准备训练环境

安装昇腾环境

请参考昇腾社区中《Pytorch框架训练环境准备》文档搭建昇腾环境。本仓已支持表1中软件版本。

表 1 昇腾软件版本支持表

软件类型 首次支持版本
FrameworkPTAdapter 7.3.0
CANN 8.5.1

安装模型环境

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

表 2 版本支持表

三方库 支持版本
Python 3.10
PyTorch 2.7.1

在模型根目录下执行命令,安装模型需要的依赖

conda create -n driverAgent python=3.10
conda activate driverAgent
cd DrivingSDK/model_examples/DriverAgent
pip install -r requirements.txt

准备数据集

获取数据集

通过该链接 datasets_driver_agent 获取训练和验证数据集

快速开始

训练模型

  • 精度训练
bash train.sh --precision
  • 性能训练
bash train.sh --performance

训练结果

表 3 训练结果展示表

芯片 卡数 训练方式 global batchsize epochs MSE FPS
竞品A 1p 混合精度 64 30 3.129 149
Atlas 800T A2 1p 混合精度 64 30 2.866 140

变更说明

2026.02.24:首次发布

2026.03.13:修复精度问题