Y
gcw_hhrLdMXW/dqn-lunarlander-v2
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

sb3/dqn-LunarLander-v2 昇腾 NPU 部署文档

1. 模型简介

DQN-LunarLander-v2 是使用 DQN 算法在 LunarLander-v2 环境上训练的深度强化学习策略模型,由 stable-baselines3 训练。

  • 架构:DQN(3 层 MLP,256维)
  • 参数:约 138K
  • 输入:8 维观测(位置/速度/角度等)
  • 输出:4 维动作(引擎控制)
  • 权重:dqn-LunarLander-v2.zip(1.1MB)
  • 官方仓库:https://huggingface.co/sb3/dqn-LunarLander-v2

2. 环境依赖清单

组件版本说明
torch2.9.0+cpuPyTorch
torch_npu2.9.0.post1昇腾 NPU 插件
stable-baselines32.9.0RL 框架
gym0.26.2环境兼容层
shimmy>=0.2.1Gym→Gymnasium 兼容

3. 推理操作流程

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
python3 inference.py

4. 测试用例与输出

策略网络参数: 138,248
前向推理基准 (runs=100):
  平均耗时: 0.450 ms / 次前向
  随机观测的动作: 1

验收结论:DQN 策略在 NPU 上前向推理正确,单次前向仅 0.450ms。

5. 目录结构

dqn-lunarlander-v2-npu-deployment/
├── inference.py
├── readme.md
├── requirements.txt
├── SKILL.md
├── model_dl/
└── assets/