CANN/cann-recipes-embodied-intelligence: ACT ALOHA昇腾训练

张开发
2026/5/9 17:39:15 15 分钟阅读

分享文章

CANN/cann-recipes-embodied-intelligence: ACT ALOHA昇腾训练
ACT ALOHA Transfer Cube 昇腾训练说明【免费下载链接】cann-recipes-embodied-intelligence本项目针对具身智能业务中的典型模型、加速算法提供基于CANN平台的优化样例项目地址: https://gitcode.com/cann/cann-recipes-embodied-intelligence1. 训练与评测结论1.1 Atlas A2 训练环境Python 3.10 已验证的 Ascend PyTorch 训练环境数据集../dataset/lerobot/aloha_sim_transfer_cube_human相对lerobot根目录长训配置act_aloha.yaml输出目录../ckpt/act_aloha_timestamp相对lerobot根目录训练步数100000默认视频后端torchcodec结论可在昇腾 Atlas A2 集群上 8 卡并行进行 ACT 模型训练1.2 在线评测评测方式CPU 执行 MuJoCo 仿真与渲染NPU 执行 policy 推理环境变量MUJOCO_GLosmesa500 episode 聚合成功率68.0%1.3torchcodec快速吞吐对比任务ACT,8 cards,per-device batch_size64,100 steps当前参考最佳结果如下配置统计区间mean_updt_smean_data_send-to-end samples/storchcodecstep 10~1000.31910.3544760.243. 为什么推荐仿真在 CPU、推理在 NPU在线 ALOHA 评测依赖 MuJoCo 的无头渲染环境。实践中更稳妥的做法是MuJoCo 仿真与渲染走 CPUpolicy 前向推理继续使用 NPU。推荐组合MUJOCO_GLosmesa--policy.devicenpu4. 当前样例依赖的 lerobot commit固定版本58f70b6bd370864139a3795ac3497a9eae8c42d5说明本样例以该 commit 作为基线patch 文件也是基于该 commit 提取的若使用不同commit的版本可以参考示例patch文件进行修改。5. 关键配置解释5.1act_aloha.yaml关键项policy.type: actpolicy.device: npudataset.root: 相对lerobot根目录的数据集路径pretrained_backbone_weights: ResNet18_Weights.IMAGENET1K_V1steps: 100000wandb.enable: true5.2act_aloha_smoke.yaml适合快速验证steps: 20save_freq: 20wandb.enable: false6. 常见问题6.1gym-aloha/ ALOHA 依赖没有装好现象env.typealoha构建失败训练还没开始就报模块缺失处理重新执行样例提供的setup.sh脚本会安装 ACT 所需的通用 Python 依赖和gym-aloha./manipulation/act/train/src/scripts/setup.sh6.2 ResNet18 权重下载失败现象模型构建阶段尝试访问外网无网环境下报权重下载失败处理提前缓存resnet18-f37072fd.pth放到~/.cache/torch/hub/checkpoints/6.3 wandb 可用性现状昇腾 Atlas A2 已验证可以使用官方 wandb如遇 token / 版本问题优先升级 wandb 再重新登录6.4torch_npu/ 平台栈没有准备好现象setup.sh末尾提示无法import torch, torch_npu或训练启动时直接报 NPU 侧依赖缺失原因torch/torchvision/torch_npu的有效组合依赖于 Ascend 软件栈、CANN 版本和机器架构因此样例不在脚本中硬编码某个固定下载链接。处理方案 1先激活一个已验证可用的 Ascend 训练环境再执行setup.sh方案 2执行setup.sh时显式传入本地 wheel 路径例如./manipulation/act/train/src/scripts/setup.sh --help ./manipulation/act/train/src/scripts/setup.sh \ --create-conda \ --env-name lerobot-act \ --python-version 3.10 \ --torch-wheel /path/to/torch.whl \ --torchvision-wheel /path/to/torchvision.whl \ --torch-npu-wheel /path/to/torch_npu.whl如已提前确认平台栈可用也可以追加--skip-torch-check跳过末尾导入校验。7. 推荐启动方式7.1 smokesource /path/to/conda.sh conda activate your-ascend-train-env source /path/to/Ascend/set_env.sh ./manipulation/act/train/src/scripts/run_train.sh act_aloha_smoke --port 295107.2 正式训练source /path/to/conda.sh conda activate your-ascend-train-env source /path/to/Ascend/set_env.sh ./manipulation/act/train/src/scripts/run_train.sh act_aloha --port 295107.3 resume./manipulation/act/train/src/scripts/run_train.sh act_aloha --resume --port 29510【免费下载链接】cann-recipes-embodied-intelligence本项目针对具身智能业务中的典型模型、加速算法提供基于CANN平台的优化样例项目地址: https://gitcode.com/cann/cann-recipes-embodied-intelligence创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

更多文章