Nerf-SLAM配置与报错

1 github仓库

https://github.com/ToniRV/NeRF-SLAM

2 步骤

照着作者给的readme一步一步来,别直接下载master,因为直接下载的master没有git中链接的第三方库。跟着readme里的指示来

git clone https://github.com/ToniRV/NeRF-SLAM.git --recurse-submodules

只有这行就可以了,第二行应该是不用的

3 报错

基本所有的报错都在gtsam编译这一步

cmake ./thirdparty/gtsam -DGTSAM_BUILD_PYTHON=1 -B build_gtsam 
cmake --build build_gtsam --config RelWithDebInfo -j
cd build_gtsam
make python-install

就是这里

1 pyparsing.exceptions.ParseException: Expected string_end, found ‘namespace’ (at char 1249), (line:46, col:1

pyparsing.exceptions.ParseException: Expected string_end, found 'namespace'  (at char 1249), (line:46, col:1)
python/CMakeFiles/pybind_wrap_gtsam_unstable.dir/build.make:75: recipe for target 'python/gtsam_unstable.cpp' failed
make[2]: *** [python/gtsam_unstable.cpp] Error 1
CMakeFiles/Makefile2:32358: recipe for target 'python/CMakeFiles/pybind_wrap_gtsam_unstable.dir/all' failed
make[1]: *** [python/CMakeFiles/pybind_wrap_gtsam_unstable.dir/all] Error 2

在这里插入图片描述

这大概是第一个报错的信息,问题出在python/gtsam_unstable.cpp里面
https://github.com/ToniRV/NeRF-SLAM/issues/9解决方法在这里

A hack that is useful for me:
directly remove +stringEnd at the 48th line of NeRF-SLAM/thirdparty/gtsam/wrap/gtwrap/interface_parser/module.py

删除NeRF-SLAM/thirdparty/gtsam/wrap/gtwrap/interface_parser/module.py里48行的+stringEnd

2 /usr/include/c++/7/bits/alloc_traits.h:392:27: error: forming pointer to reference type ‘const Eigen::Matrix<double, -1, -1>&’

/usr/include/c++/7/bits/alloc_traits.h:392:27: error: forming pointer to reference type ‘const Eigen::Matrix<double, -1, -1>&’

在这里插入图片描述
报错如上,解决办法在
https://github.com/ToniRV/NeRF-SLAM/issues/7

大概就是

You may change const std::vector<const gtsam::Matrix&>& to const std::vector<gtsam::Matrix>& use & as pointer is not proper define of std::vector

build_gtsam/python/linear.cpp里面的std::vector<const gtsam::Matrix&>&改为std::vector<gtsam::Matrix>&

3 /usr/include/c++/7/ext/new_allocator.h:93:7: error: ‘const _Tp* __gnu_cxx::new_allocator<_Tp>: :address(__gnu_cxx::new_allocator<_Tp>::const_reference) const [with _Tp = const Eigen: :Matrix<double, -1, -1>; _gnu

在这里插入图片描述很多解决方法都在
https://github.com/ToniRV/NeRF-SLAM/issues/7
可以自己找找,不过我找到个解决一切的办法,也是在上述链接中。想自己慢慢改的也可以接着看,不想改了见下一条。

4

在这里插入图片描述牛逼好吧,删了再git一次后重新编译,啥问题也没有了

### 部署 NeRF-SLAM 的指南 NeRF-SLAM 结合了神经辐射场 (NeRF) 和同步定位地图构建 (SLAM),旨在创建三维环境模型并实现实时导航。为了成功部署 NeRF-SLAM,需遵循一系列配置和安装步骤。 #### 准备工作环境 确保操作系统支持最新版本的 Python 以及必要的依赖库。推荐使用 Anaconda 或 Miniconda 来管理虚拟环境[^1]。 ```bash conda create -n nerf_slam_env python=3.9 conda activate nerf_slam_env ``` #### 安装依赖项 下载官方 GitHub 仓库中的 NeRF-SLAM 项目文件,并按照 README.md 中列出的要求安装所需的软件包[^2]。 ```bash git clone https://github.com/your-repo/nerf-slam.git cd nerf-slam pip install -r requirements.txt ``` #### 数据集准备 获取适当的数据集用于训练和测试。这通常涉及收集 RGB-D 图像序列或其他形式的空间感知数据。对于某些特定应用场合可能还需要额外标注信息[^3]。 #### 训练过程 调整参数设置以适应具体应用场景的需求,在本地计算机上运行训练脚本之前,请仔细阅读文档说明部分关于超参调优的内容[^4]。 ```python import torch from models import NerfSlamModel model = NerfSlamModel() optimizer = torch.optim.Adam(model.parameters(), lr=0.001) for epoch in range(num_epochs): optimizer.zero_grad() loss = model.compute_loss(input_data) loss.backward() optimizer.step() ``` #### 测试评估 完成训练之后,利用预定义好的验证集来检验算法性能指标是否达到预期效果。如果有必要的话可以进一步优化网络结构或改进输入特征提取方法[^5]。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值