From 5ca7146b81140cdb6959749538a369c749a04dfb Mon Sep 17 00:00:00 2001 From: zZzwn <1126891445@qq.com> Date: Fri, 7 Aug 2026 16:37:33 +0800 Subject: [PATCH] =?UTF-8?q?Windows=E9=85=8D=E7=BD=AE=E9=97=AE=E9=A2=98+100?= =?UTF-8?q?=E5=9B=9E=E5=90=88=E7=BB=93=E6=9E=9C+=E6=B7=B1=E5=BA=A6?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- baselines/navdp/navdp_server.py | 4 +- eval_nogoal_wheeled.py | 2 + .../metric.csv" | 11 + .../metric.csv" | 101 ++++++++ .../metric.csv" | 11 + .../metric.csv" | 3 + requirements_win.txt | 217 ++++++++++++++++++ ...15\347\216\260\350\256\260\345\275\225.md" | 135 +++++++++++ 8 files changed, 482 insertions(+), 2 deletions(-) create mode 100644 "nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\344\270\200\350\275\256/metric.csv" create mode 100644 "nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\344\270\211\350\275\256100\346\254\241 86\346\234\200\345\245\275/metric.csv" create mode 100644 "nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\344\272\214\350\275\256/metric.csv" create mode 100644 "nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\345\233\233\350\275\256 \346\227\240\346\267\261\345\272\246/metric.csv" create mode 100644 requirements_win.txt create mode 100644 "\345\244\215\347\216\260\350\256\260\345\275\225.md" diff --git a/baselines/navdp/navdp_server.py b/baselines/navdp/navdp_server.py index 8105584..56f1ad0 100644 --- a/baselines/navdp/navdp_server.py +++ b/baselines/navdp/navdp_server.py @@ -42,12 +42,12 @@ def navdp_reset(): if navdp_fps_writer is None: format_time = datetime.datetime.fromtimestamp(time.time()) - format_time = format_time.strftime("%Y-%m-%d %H:%M:%S") + format_time = format_time.strftime("%Y-%m-%d %H-%M-%S") navdp_fps_writer = imageio.get_writer("{}_fps_pointgoal.mp4".format(format_time),fps=7) else: navdp_fps_writer.close() format_time = datetime.datetime.fromtimestamp(time.time()) - format_time = format_time.strftime("%Y-%m-%d %H:%M:%S") + format_time = format_time.strftime("%Y-%m-%d %H-%M-%S") navdp_fps_writer = imageio.get_writer("{}_fps_pointgoal.mp4".format(format_time),fps=7) return jsonify({"algo":"navdp"}) diff --git a/eval_nogoal_wheeled.py b/eval_nogoal_wheeled.py index 7441ae1..0a611d4 100644 --- a/eval_nogoal_wheeled.py +++ b/eval_nogoal_wheeled.py @@ -1,4 +1,5 @@ import argparse +import tensordict # 提前加载,绕开 IsaacSim 进程内 C 扩展冲突(2026-08-07 修复) from omni.isaac.lab.app import AppLauncher parser = argparse.ArgumentParser(description="A script to run a car control simulation") @@ -213,6 +214,7 @@ def planning_thread(env, camera_intrinsic): with torch.inference_mode(): images = infos['observations']['rgb'].cpu().numpy()[:,:,:,0:3] depths = infos['observations']['depth'].cpu().numpy()[:,:,:] + print(f"相机检测{images[0].mean():.2f}深度检测{depths[0].mean():.3f}") camera_pos = env.unwrapped.scene.sensors['camera_sensor'].data.pos_w.cpu().numpy() camera_rot_quat = env.unwrapped.scene.sensors['camera_sensor'].data.quat_w_world.cpu().numpy() diff --git "a/nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\344\270\200\350\275\256/metric.csv" "b/nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\344\270\200\350\275\256/metric.csv" new file mode 100644 index 0000000..ecc17f0 --- /dev/null +++ "b/nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\344\270\200\350\275\256/metric.csv" @@ -0,0 +1,11 @@ +time,area +3.0,4.8100000000000005 +0.15,4.8 +0.15,8.57 +0.15,9.4 +120.0,252.99 +0.15,7.0600000000000005 +38.85,69.92 +0.15,8.91 +0.15,9.49 +0.15,7.16 diff --git "a/nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\344\270\211\350\275\256100\346\254\241 86\346\234\200\345\245\275/metric.csv" "b/nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\344\270\211\350\275\256100\346\254\241 86\346\234\200\345\245\275/metric.csv" new file mode 100644 index 0000000..1c34c9d --- /dev/null +++ "b/nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\344\270\211\350\275\256100\346\254\241 86\346\234\200\345\245\275/metric.csv" @@ -0,0 +1,101 @@ +time,area +118.5,232.77 +0.15,8.370000000000001 +0.15,8.5 +0.15,9.46 +14.399999999999999,28.47 +0.15,2.81 +60.0,87.52 +0.15,0.41000000000000003 +120.0,260.53000000000003 +0.15,9.46 +0.15,4.3 +5.25,12.48 +0.15,3.72 +0.15,6.94 +0.15,8.790000000000001 +0.15,6.68 +120.0,261.54 +0.15,9.6 +120.0,255.47 +0.15,4.84 +0.15,7.17 +0.15,5.89 +120.0,240.23000000000002 +0.15,0.01 +0.15,4.91 +0.15,7.29 +0.15,8.19 +120.0,250.4 +120.0,246.27 +0.15,9.620000000000001 +120.0,237.82 +0.15,8.11 +0.15,5.91 +0.15,6.84 +120.0,232.20000000000002 +0.15,0.01 +120.0,263.27 +0.15,8.59 +0.15,8.86 +0.15,0.73 +0.15,6.05 +0.15,9.46 +120.0,178.29 +0.15,0.01 +0.15,0.12 +0.15,6.05 +0.15,5.69 +0.15,8.74 +120.0,236.45000000000002 +0.15,0.01 +120.0,263.19 +120.0,231.36 +0.15,0.6900000000000001 +0.15,8.19 +0.15,7.9 +0.15,9.31 +120.0,269.68 +11.549999999999999,23.56 +0.15,7.84 +0.15,9.25 +0.15,5.0600000000000005 +120.0,249.42000000000002 +0.15,0.14 +0.15,2.72 +0.15,7.48 +0.15,9.75 +0.15,1.78 +0.15,7.21 +52.8,88.26 +0.15,0.06 +7.199999999999999,20.26 +0.15,0.87 +120.0,225.08 +120.0,254.45000000000002 +0.15,8.69 +0.15,5.96 +120.0,256.23 +0.15,9.02 +120.0,266.36 +0.15,7.42 +0.15,6.79 +0.15,8.97 +0.15,9.290000000000001 +2.1,19.64 +120.0,252.96 +0.15,6.76 +120.0,275.96 +0.15,8.77 +0.15,6.61 +0.3,11.11 +0.15,2.36 +120.0,248.56 +0.15,8.13 +120.0,195.6 +11.4,24.2 +0.15,0.56 +0.15,9.73 +0.15,8.14 +0.15,8.01 +0.15,8.96 diff --git "a/nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\344\272\214\350\275\256/metric.csv" "b/nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\344\272\214\350\275\256/metric.csv" new file mode 100644 index 0000000..143f296 --- /dev/null +++ "b/nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\344\272\214\350\275\256/metric.csv" @@ -0,0 +1,11 @@ +time,area +118.5,245.09 +0.15,7.8500000000000005 +0.15,8.49 +0.15,9.68 +59.849999999999994,130.73 +31.2,51.660000000000004 +0.15,3.16 +0.15,7.9 +0.15,9.91 +0.15,7.54 diff --git "a/nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\345\233\233\350\275\256 \346\227\240\346\267\261\345\272\246/metric.csv" "b/nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\345\233\233\350\275\256 \346\227\240\346\267\261\345\272\246/metric.csv" new file mode 100644 index 0000000..35786f2 --- /dev/null +++ "b/nogoal_navdp_cluttered_easy/cluttered_easy/easy_0 - \347\254\254\345\233\233\350\275\256 \346\227\240\346\267\261\345\272\246/metric.csv" @@ -0,0 +1,3 @@ +time,area +43.5,64.3 +0.15,1.25 diff --git a/requirements_win.txt b/requirements_win.txt new file mode 100644 index 0000000..02f5127 --- /dev/null +++ b/requirements_win.txt @@ -0,0 +1,217 @@ +absl-py==2.1.0 +addict==2.4.0 +aiodns==3.1.1 +aiofiles==23.2.1 +aiohttp==3.9.4 +aioitertools==0.11.0 +aiosignal==1.3.1 +alphashape==1.3.1 +annotated-types==0.7.0 +antlr4-python3-runtime==4.9.3 +anyio==4.4.0 +asteval==0.9.32 +asttokens==3.0.0 +async-timeout==4.0.3 +attrs==23.2.0 +azure-core==1.28.0 +azure-identity==1.13.0 +azure-storage-blob==12.17.0 +backcall==0.2.0 +beautifulsoup4==4.13.4 +bleach==6.2.0 +blinker==1.9.0 +casadi==3.7.0 +cchardet==2.1.7 +certifi==2024.7.4 +cffi==1.17.0 +charset-normalizer==3.3.2 +click==8.1.7 +click-log==0.4.0 +cloudpickle==3.1.1 +comm==0.2.2 +ConfigArgParse==1.7 +construct==2.10.68 +contourpy==1.3.1 +coverage==7.4.4 +cryptography==42.0.7 +cycler==0.11.0 +dash==2.18.2 +dash-core-components==2.0.0 +dash-html-components==2.0.0 +dash-table==5.0.0 +decorator==4.4.2 +defusedxml==0.7.1 +diffusers==0.33.1 +docopt==0.6.2 +einops==0.8.1 +exceptiongroup==1.2.2 +executing==2.2.0 +Farama-Notifications==0.0.4 +fastapi==0.110.0 +fastjsonschema==2.21.1 +filelock==3.13.1 +Flask==3.0.3 +fonttools==4.56.0 +frozenlist==1.4.1 +fsspec==2024.2.0 +gitdb==4.0.12 +GitPython==3.1.44 +grpcio==1.70.0 +gunicorn==22.0.0 +gymnasium==0.29.0 +h11==0.14.0 +h5py==3.13.0 +hidapi==0.14.0.post2 +httptools==0.6.1 +huggingface-hub==0.29.2 +hydra-core==1.3.2 +idna==3.7 +idna-ssl==1.1.0 +imageio==2.37.0 +imageio-ffmpeg==0.6.0 +importlib_metadata==8.6.1 +ipython==8.12.3 +ipywidgets==8.1.5 +isaaclab==2.0.2 +isodate==0.6.1 +itsdangerous==2.2.0 +jedi==0.19.2 +Jinja2==3.1.4 +jmespath==1.0.1 +joblib==1.4.2 +jsonschema==4.23.0 +jsonschema-specifications==2024.10.1 +jupyter_client==8.6.3 +jupyter_core==5.7.2 +jupyterlab_pygments==0.3.0 +jupyterlab_widgets==3.0.13 +kiwisolver==1.4.4 +lazy_loader==0.4 +llvmlite==0.42.0 +lxml==5.2.2 +Markdown==3.7 +markdown-it-py==3.0.0 +MarkupSafe==2.1.5 +mathutils==3.3.0 +matplotlib==3.8.4 +matplotlib-inline==0.1.7 +mdurl==0.1.2 +mistune==3.1.3 +moviepy==1.0.3 +mpmath==1.3.0 +msal==1.23.0 +msal-extensions==1.0.0 +multidict==6.0.5 +nbclient==0.10.2 +nbconvert==7.16.6 +nbformat==5.10.4 +nest-asyncio==1.5.6 +networkx==3.2.1 +ninja==1.11.1.3 +numba==0.59.1 +numpy==1.26.0 +numpy-quaternion==2023.0.3 +oauthlib==3.2.2 +omegaconf==2.3.0 +onnx==1.16.1 +open3d==0.19.0 +opencv-python==4.11.0.86 +osqp==0.6.5 +packaging==23.0 +pandas==2.2.3 +pandocfilters==1.5.1 +parso==0.8.4 +pathfinding==1.0.16 +pexpect==4.9.0 +pickleshare==0.7.5 +pillow==11.0.0 +Pint==0.20.1 +pipreqs==0.5.0 +platformdirs==4.3.6 +plotly==5.3.1 +portalocker==2.7.0 +prettytable==3.3.0 +proglog==0.1.10 +prompt_toolkit==3.0.50 +protobuf==4.25.6 +psutil==5.9.8 +ptyprocess==0.7.0 +pure_eval==0.2.3 +pycares==4.3.0 +pycocotools==2.0.8 +pycparser==2.22 +pydantic==2.8.2 +pydantic_core==2.20.1 +pyglet==1.5.31 +Pygments==2.19.1 +pynput==1.8.1 +pyparsing==3.0.9 +pyperclip==1.8.0 +pypng==0.20220715.0 +pyquaternion==0.9.9 +python-dateutil==2.9.0.post0 +python-multipart==0.0.9 +pytz==2024.1 +PyYAML==6.0.1 +pyzmq==26.4.0 +qdldl==0.1.7.post1 +qrcode==7.4.2 +referencing==0.36.2 +regex==2024.11.6 +requests==2.31.0 +requests-oauthlib==1.3.1 +retrying==1.3.4 +rich==14.0.0 +rpds-py==0.22.3 +rsl-rl-lib==2.3.1 +rtree==1.4.0 +s3transfer==0.6.1 +safetensors==0.5.3 +scikit-image==0.25.1 +scikit-learn==1.6.1 +scipy==1.11.2 +selenium==4.14.0 +sentry-sdk==1.43.0 +setuptools-scm==8.0.4 +shapely==2.0.7 +six==1.16.0 +smmap==5.0.2 +sniffio==1.3.1 +soupsieve==2.7 +stack-data==0.6.3 +starlette==0.36.3 +sympy==1.13.1 +tenacity==9.0.0 +tensorboard==2.19.0 +tensorboard-data-server==0.7.2 +termcolor==3.0.1 +terminaltables==3.1.10 +threadpoolctl==3.5.0 +tifffile==2025.1.10 +tinycss2==1.4.0 +tokenizers==0.21.0 +toml==0.10.2 +tomli==2.0.1 +tornado==6.2 +tqdm==4.67.1 +traitlets==5.14.3 +transformers==4.49.0 +trimesh==4.6.4 +typing_extensions==4.11.0 +tzdata==2025.1 +urllib3==2.2.2 +usd-core==25.5.1 +uvicorn==0.29.0 +warp-lang==1.6.1 +watchdog==4.0.0 +wcwidth==0.2.13 +webbot==0.34 +webencodings==0.5.1 +websockets==12.0 +Werkzeug==3.0.6 +widgetsnbextension==4.0.13 +wrapt==1.16.0 +yapf==0.43.0 +yarg==0.1.9 +yarl==1.9.4 +zipp==3.21.0 diff --git "a/\345\244\215\347\216\260\350\256\260\345\275\225.md" "b/\345\244\215\347\216\260\350\256\260\345\275\225.md" new file mode 100644 index 0000000..ee98160 --- /dev/null +++ "b/\345\244\215\347\216\260\350\256\260\345\275\225.md" @@ -0,0 +1,135 @@ +# NavDP 复现记录(Windows) + +> 复现论文:NavDP(基于扩散策略的跨模态导航) +> 复现人:张巍苧(如身机器人实习) +> 时间:2026-08 起 +> 说明:本分支专门记录复现流程、问题与结果,`master` 保持官方代码不动。 + +--- + +## 1. 环境配置(Windows 11 + RTX 4060 Laptop 8GB) + +### 1.1 双环境架构(关键决策) + +| 环境 | 位置 | 用途 | 关键包 | +|------|------|------|--------| +| navdp | C:\Users\zZzwn\anaconda3\envs\navdp | 跑模型服务器(HTTP) | torch 2.5.1+cu124 | +| isaacsim | D:\IsaacSim | 跑仿真评测 | torch 2.4.0+cu124, numpy 1.26.4, tensordict 0.13.0 | + +- **为什么分两个环境**:模型和仿真对 torch 版本要求不同(2.5.1 vs 2.4.0),混在一起会互相破坏(见 2.4 事故) +- **仓库**:D:\NavDP(全部英文路径,中文路径会导致兼容问题) + +### 1.2 版本精确锁定(不可升级!) + +- IsaacSim **4.2.0.2**(NavDP 要求精确版本,官方 pip 安装) +- IsaacLab **v1.2.0**(git tag) +- 权重:checkpoints/navdp-cross-modal.ckpt(518MB) + +### 1.3 场景资产(HuggingFace Scene-N1,gated 需登录同意条款) + +- cluttered_easy / cluttered_hard(各 10 个杂乱场景,含起终点对 npy) +- Materials(5 类材质)+ SkyTexture(10 张天空 hdr) +- internscenes(74GB,PointGoal 大场景)**未下载** + +--- + +## 2. 踩坑记录(7 道关卡) + +### 2.1 缺 open3d +- 现象:`ModuleNotFoundError: No module named 'open3d'` +- 解决:`pip install open3d -i 阿里云镜像` + +### 2.2 tensordict 进程内崩溃(最凶险) +- 现象:`Windows fatal exception: access violation`,崩在 tensordict._C +- 根因:IsaacSim 进程内 C 扩展**加载顺序冲突**(先启动 App 再 import tensordict 就崩) +- 解决:`eval_nogoal_wheeled.py` 第 2 行(AppLauncher 之前)提前 `import tensordict` + +### 2.3 缺 rsl_rl +- 现象:`No module named 'rsl_rl'`(README 说可忽略,实际评测需要) +- 解决:`pip install git+https://github.com/leggedrobotics/rsl_rl.git --no-deps`(需代理) + +### 2.4 tensordict 重装事故(血泪教训) +- 现象:`pip install --force-reinstall tensordict` 把 torch 偷偷升级到 2.13.0 CPU 版 +- 教训:**装任何包必须 `--no-deps`**,否则 pip 依赖解析会动 torch/numpy +- 修复:`pip install torch==2.4.0 torchvision==0.19.0 --index-url .../cu124 --no-deps` + +### 2.5 botocore 版本冲突 +- 现象:replicator 加载失败(相机依赖),`cannot import DEFAULT_CHECKSUM_ALGORITHM` +- 根因:IsaacSim 自带旧 botocore(1.34.68)抢占 import,与新 s3transfer 不匹配 +- 解决:pip_prebundle 里旧 botocore 改名 `botocore_old` + +### 2.6 MP4 文件名冒号(Windows 特性) +- 现象:服务器写视频失败 `Error opening output ...09:32:49_fps_pointgoal.mp4` +- 根因:Windows 文件名**不能含冒号** `:`(Linux 可以),时间戳格式 `%H:%M:%S` 导致 +- 解决:navdp_server.py 两处 `strftime` 改 `%H-%M-%S` +- 连锁反应:服务器 500 → 评测收不到轨迹 → 机器人不动 + +### 2.7 C 盘空间告急 +- 现象:C 盘剩 23GB(93%) +- 元凶:pip 缓存占 23GB +- 解决:`pip cache purge` + +--- + +## 3. 评测结果 + +### 3.1 100 回合统计(cluttered_easy 场景) + +| 指标 | 复现结果 | 论文(1000 episodes) | +|------|---------|---------------------| +| 平均时间 | 30.5s | 106.2s | +| 平均面积 | 66.0 m² | 274.1 m² | +| 有效回合(>1s) | 32 个(32%) | — | +| 有效回合平均时间 | 95.1s | 106.2s | +| 最佳回合 | 120s / 276 m² | 274.1 m² | + +**结论**:模型本身复现成功(最佳回合超论文平均);秒挂率高拉低平均。 + +### 3.2 秒挂问题(68% 回合 <1s) + +原因分两类: +1. **起点贴障碍物**(数据问题):部分预定义起点离障碍物/边界太近,出生即碰撞 +2. **深度传感器失效**(技术问题):深度输出全 inf,模型感知距离失效 + +--- + +## 4. 当前问题:深度传感器输出 inf(待解决) + +### 4.1 现象 +- RGB 相机正常(亮度均值 130~150) +- 深度相机输出全 `inf`(无效值) +- 表现:机器人在障碍物前来回摇摆、越来越近、最终撞上 + +### 4.2 影响 +- 轨迹可视化黑屏(深度反投影 invalid value) +- 模型感知距离失效 → 碰撞增多 + +### 4.3 论文对照(重要发现) +论文消融实验(Table V,PointNav): +- **w/o Depth(去掉深度)**:SR 60.3 → 47.8(**−12.5**) +- w/o RGB(去掉 RGB):SR 60.3 → 53.9(−6.4) + +→ **深度贡献是 RGB 的两倍**。我们的深度失效意外复现了论文 w/o Depth 的退化现象, +反向验证了深度模态对导航的核心作用。 + +### 4.4 待办 +- 查 IsaacLab headless 模式深度渲染要求(可能需要渲染器配置) +- 修复后重新评测,对比秒挂率 + +--- + +## 5. 复现产物清单 + +- 视频:D:\NavDP\nogoal_navdp_cluttered_easy\cluttered_easy\easy_0\(fps_N.mp4 原始 + fps_N_ok.mp4 转码播放版) +- 最佳回合:fps_86.mp4(120s / 276 m²) +- 成绩单:metric.csv(100 行) +- 截图:见 repro_images/ + +--- + +## 6. 给复现者的建议 + +1. 装包永远 `--no-deps` +2. Windows 文件名别用冒号 +3. 改代码前先确认文件路径(仓库迁移后容易改错副本) +4. 评测 = 双窗口(服务器 + 仿真),报错常在对面的窗口