nerfstudio可以参考大佬的博客,但是由于系统不同我出现了很多其他的bug
(60条消息) Ubuntu系统复现NeRFStudio(详细)_XINYU W的博客-CSDN博客
-
git clone --recursive https://github.com/nvlabs/tiny-cuda-nn
-
cd tiny-cuda-nn
-
cmake . -B build
-
cmake --build build --config RelWithDebInfo -j
-
cd binding/torch
-
pip setup.py install
首先是在binding/torch,setup的时候报错,issue里有部分人觉得是GPU和CPU的架构没有统一,但我是ubuntu系统不知道咋统一,故选择了另一种方法
Error compiling objects for extension
you should open setup.py ,find “cmdclass={'build_ext': BuildExtension}” ,remove it and instead with “cmdclass={'build_ext': BuildExtension.with_options(use_ninja=False)}”,实测可行,另外附上上一种方法的windows解决方案
I found the reason is MSVC 2019 use X86 but nvcc use X64. So open you developer command promot for VS 2019 and use the command:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 to make your msvc change to x64.
error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1
先找到python位置
whereis python#当前环境使用python版本
sudo python位置 setup.py build develop
No such file or directory: ‘:/usr/local/cuda-11.7:/usr/local/cuda-11.7/bin/nvcc‘
直接在命令行里输入
export CUDA_HOME=/usr/local/cuda
ImportError: /home/star/anaconda3/envs/ns/lib/python3.8/site-packages/tinycudann-1.7-py3.8-linux-x86_64.egg/tinycudann_bindings/_86_C.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN2at4_ops19empty_memory_format4callEN3c108ArrayRefIlEENS2_8optionalINS2_10ScalarTypeEEENS5_INS2_6LayoutEEENS5_INS2_6DeviceEEENS5_IbEENS5_INS2_12MemoryFormatEEE
这个错误的原因是编译完tinycudann后又去更新了torch版本,重新编译一遍tinycudann,最好是全部删了重新编译
然后再import tinycudann,不报错就成功了,安装nerfstudio
-
git clone https://github.com/nerfstudio-project/nerfstudio.git
-
cd nerfstudio
-
pip install --upgrade pip setuptools
-
pip install -e .
指定使用的gpu,export CUDA_VISIBLE_DEVICES=6,7
-
# 下载数据集
-
ns-download-data nerfstudio --capture-name=poster
-
# 训练模型
-
ns-train nerfacto --data data/nerfstudio/poster

成功开始训练,太不容易了,训练完以后,Render可以生成视频,Export可以生成点云和mesh,render可以定义相机,首先,我们必须为相机创建一条路径。这可以在"RENDER" 选项卡下的查看器中完成。将您的 3D 视图定位到您希望视频开始的位置,然后按 "ADD CAMERA"。这将设置第一个相机关键帧。继续使用新视点添加额外的相机来创建相机路径。我们提供其他参数来进一步优化您的相机路径。接下来将研究用nerfstudio渲染自己的数据集

文章描述了在Ubuntu系统中安装和配置NERFStudio时遇到的编译错误,包括Torch扩展的构建问题和CUDA版本不匹配。作者提供了修改setup.py文件和设置CUDA环境变量的解决方案,并提到了重新编译TinyCuDNn以解决与更新的Torch版本不兼容的问题。最后,文章概述了如何成功运行NERFStudio并开始训练。
5864

被折叠的 条评论
为什么被折叠?



