TORCH-NGP环境配置

news/2025/1/8 3:59:12/文章来源:https://www.cnblogs.com/XL2COWARD/p/18655767

楼主的服务器是NVIDIA RTX 4090,可支持12.2CUDA驱动,但是TORCH-NGP中CUDA函数与TORCH=1.11.0版本适配,因此需要安装符合TORCH-NGP的CUDA环境。建议不要用github官网上的指令【https://github.com/ashawkey/torch-ngp】去下载,会出现一系列问题。

  • create -n torch-ngp python=3.9
  • conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch
  • bash scripts/install_ext.sh 安装raymarching
  • python main_nerf.py data/fox --workspace trial_nerf 执行这条指令根据报错安装剩余的库,这里要尤其注意torchmetric,安装和pytotrch=1.11.0适配的0.7.0版本的torchmetric,pip install torchmetric=0.7.0,否则回导致安装新的torch覆盖原有torch和cuda环境,造成so链接失误。
  • 运行成功后会提示找不到data/fox,可以在 https://github.com/NVlabs/instant-ngp/tree/master 中下载。
### Instant-ngp NeRF
# train with different backbones (with slower pytorch ray marching)
# for the colmap dataset, the default dataset setting `--bound 2 --scale 0.33` is used.
python main_nerf.py data/fox --workspace trial_nerf # fp32 mode
python main_nerf.py data/fox --workspace trial_nerf --fp16 # fp16 mode (pytorch amp)
python main_nerf.py data/fox --workspace trial_nerf --fp16 --ff # fp16 mode + FFMLP (this repo's implementation)
python main_nerf.py data/fox --workspace trial_nerf --fp16 --tcnn # fp16 mode + official tinycudann's encoder & MLP# use CUDA to accelerate ray marching (much more faster!)
python main_nerf.py data/fox --workspace trial_nerf --fp16 --cuda_ray # fp16 mode + cuda raymarching# preload data into GPU, accelerate training but use more GPU memory.
python main_nerf.py data/fox --workspace trial_nerf --fp16 --preload# one for all: -O means --fp16 --cuda_ray --preload, which usually gives the best results balanced on speed & performance.
python main_nerf.py data/fox --workspace trial_nerf -O# test mode
python main_nerf.py data/fox --workspace trial_nerf -O --test# construct an error_map for each image, and sample rays based on the training error (slow down training but get better performance with the same number of training steps)
python main_nerf.py data/fox --workspace trial_nerf -O --error_map# use a background model (e.g., a sphere with radius = 32), can supress noises for real-world 360 dataset
python main_nerf.py data/firekeeper --workspace trial_nerf -O --bg_radius 32# start a GUI for NeRF training & visualization
# always use with `--fp16 --cuda_ray` for an acceptable framerate!
python main_nerf.py data/fox --workspace trial_nerf -O --gui# test mode for GUI
python main_nerf.py data/fox --workspace trial_nerf -O --gui --test# for the blender dataset, you should add `--bound 1.0 --scale 0.8 --dt_gamma 0`
# --bound means the scene is assumed to be inside box[-bound, bound]
# --scale adjusts the camera locaction to make sure it falls inside the above bounding box. 
# --dt_gamma controls the adaptive ray marching speed, set to 0 turns it off.
python main_nerf.py data/nerf_synthetic/lego --workspace trial_nerf -O --bound 1.0 --scale 0.8 --dt_gamma 0
python main_nerf.py data/nerf_synthetic/lego --workspace trial_nerf -O --bound 1.0 --scale 0.8 --dt_gamma 0 --gui# for the LLFF dataset, you should first convert it to nerf-compatible format:
python scripts/llff2nerf.py data/nerf_llff_data/fern # by default it use full-resolution images, and write `transforms.json` to the folder
python scripts/llff2nerf.py data/nerf_llff_data/fern --images images_4 --downscale 4 # if you prefer to use the low-resolution images
# then you can train as a colmap dataset (you'll need to tune the scale & bound if necessary):
python main_nerf.py data/nerf_llff_data/fern --workspace trial_nerf -O
python main_nerf.py data/nerf_llff_data/fern --workspace trial_nerf -O --gui# for the Tanks&Temples dataset, you should first convert it to nerf-compatible format:
python scripts/tanks2nerf.py data/TanksAndTemple/Family # write `trainsforms_{split}.json` for [train, val, test]
# then you can train as a blender dataset (you'll need to tune the scale & bound if necessary)
python main_nerf.py data/TanksAndTemple/Family --workspace trial_nerf_family -O --bound 1.0 --scale 0.33 --dt_gamma 0
python main_nerf.py data/TanksAndTemple/Family --workspace trial_nerf_family -O --bound 1.0 --scale 0.33 --dt_gamma 0 --gui# for custom dataset, you should:
# 1. take a video / many photos from different views 
# 2. put the video under a path like ./data/custom/video.mp4 or the images under ./data/custom/images/*.jpg.
# 3. call the preprocess code: (should install ffmpeg and colmap first! refer to the file for more options)
python scripts/colmap2nerf.py --video ./data/custom/video.mp4 --run_colmap # if use video
python scripts/colmap2nerf.py --images ./data/custom/images/ --run_colmap # if use images
python scripts/colmap2nerf.py --video ./data/custom/video.mp4 --run_colmap --dynamic # if the scene is dynamic (for D-NeRF settings), add the time for each frame.
# 4. it should create the transform.json, and you can train with: (you'll need to try with different scale & bound & dt_gamma to make the object correctly located in the bounding box and render fluently.)
python main_nerf.py data/custom --workspace trial_nerf_custom -O --gui --scale 2.0 --bound 1.0 --dt_gamma 0.02### Instant-ngp SDF
python main_sdf.py data/armadillo.obj --workspace trial_sdf
python main_sdf.py data/armadillo.obj --workspace trial_sdf --fp16
python main_sdf.py data/armadillo.obj --workspace trial_sdf --fp16 --ff
python main_sdf.py data/armadillo.obj --workspace trial_sdf --fp16 --tcnnpython main_sdf.py data/armadillo.obj --workspace trial_sdf --fp16 --test### TensoRF
# almost the same as Instant-ngp NeRF, just replace the main script.
python main_tensoRF.py data/fox --workspace trial_tensoRF -O
python main_tensoRF.py data/nerf_synthetic/lego --workspace trial_tensoRF -O --bound 1.0 --scale 0.8 --dt_gamma 0 ### CCNeRF
# training on single objects, turn on --error_map for better quality.
python main_CCNeRF.py data/nerf_synthetic/chair --workspace trial_cc_chair -O --bound 1.0 --scale 0.67 --dt_gamma 0 --error_map
python main_CCNeRF.py data/nerf_synthetic/ficus --workspace trial_cc_ficus -O --bound 1.0 --scale 0.67 --dt_gamma 0 --error_map
python main_CCNeRF.py data/nerf_synthetic/hotdog --workspace trial_cc_hotdog -O --bound 1.0 --scale 0.67 --dt_gamma 0 --error_map
# compose, use a larger bound and more samples per ray for better quality.
python main_CCNeRF.py data/nerf_synthetic/hotdog --workspace trial_cc_hotdog -O --bound 2.0 --scale 0.67 --dt_gamma 0 --max_steps 2048 --test --compose
# compose + gui, only about 1 FPS without dynamic resolution... just for quick verification of composition results.
python main_CCNeRF.py data/nerf_synthetic/hotdog --workspace trial_cc_hotdog -O --bound 2.0 --scale 0.67 --dt_gamma 0 --test --compose --gui### D-NeRF
# almost the same as Instant-ngp NeRF, just replace the main script.
# use deformation to model dynamic scene
python main_dnerf.py data/dnerf/jumpingjacks --workspace trial_dnerf_jumpingjacks -O --bound 1.0 --scale 0.8 --dt_gamma 0
python main_dnerf.py data/dnerf/jumpingjacks --workspace trial_dnerf_jumpingjacks -O --bound 1.0 --scale 0.8 --dt_gamma 0 --gui
# use temporal basis to model dynamic scene
python main_dnerf.py data/dnerf/jumpingjacks --workspace trial_dnerf_basis_jumpingjacks -O --bound 1.0 --scale 0.8 --dt_gamma 0 --basis
python main_dnerf.py data/dnerf/jumpingjacks --workspace trial_dnerf_basis_jumpingjacks -O --bound 1.0 --scale 0.8 --dt_gamma 0 --basis --gui
# for the hypernerf dataset, first convert it into nerf-compatible format:
python scripts/hyper2nerf.py data/split-cookie --downscale 2 # will generate transforms*.json
python main_dnerf.py data/split-cookie/ --workspace trial_dnerf_cookies -O --bound 1 --scale 0.3 --dt_gamma 0

数据集

nerf_synthetic https://drive.google.com/drive/folders/128yBriW1IG_3NJ5Rp7APSTZsJqdJdfc1
Tanks&Temples: https://dl.fbaipublicfiles.com/nsvf/dataset/TanksAndTemple.zip
LLFF: https://github.com/ashawkey/torch-ngp/blob/main/scripts/llff2nerf.py
Mip-NeRF 360: http://storage.googleapis.com/gresearch/refraw360/360_v2.zip
(dynamic) D-NeRF https://www.dropbox.com/s/0bf6fl0ye2vz3vr/data.zip?dl=0
(dynamic) Hyper-NeRF: https://github.com/google/hypernerf/releases/tag/v0.1

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/865021.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

FMC子卡设计原理图:165-2路万兆光纤SFP+ FMC子卡模块

2路万兆光纤SFP+ FMC子卡模块1. 概述  该板卡是基于kc705和ml605的fmc 10g万兆光纤扩展板设计。  SFP+(10 Gigabit Small Form Factor Pluggable)是一种可热插拔的,独立于通信协议的光学收发器,通常传输光的波长是 850nm, 1310nm 或1550nm,用于10G bps的SONET/SDH,光…

FMC子卡设计方案:127-4通道 12bit 125Msps 直流耦合 AD FMC 子卡

DA输出子卡 , FMC 子卡 , 中低频信号采集 , 模拟信号输入 , FL9627模块4通道 12bit 125Msps 直流耦合 AD FMC 子卡一、板卡概述:FMC 高速 AD 模块 FL9627 为 4 路 125MSPS, 12 位的模拟信号转数字信号模块。 FMC 模块的 AD 转换采用了 2 片 ADI 公司的 AD9627 芯片,每个 AD9…

跨时区协作:娱乐公司团队的全球化利器!

在线文档协作工具如何提升娱乐公司团队的创意效率? 在娱乐行业,创意是核心竞争力。无论是剧本创作、音乐制作,还是影视后期,团队协作的效率直接决定了项目的成败。而在线文档协作工具,正是提升这一效率的利器。今天,我们就从一个具体的点来发散——“实时协作”,看看它如…

tableau连接不上mysql或不显示mysql表的终极解决方法.220301

【报错一】连不上mysql An error occurred while communicating with MySQL The connection to the data source might have been lost. Error Code: 2868C972 The protocol is disconnected! Unable to connect to the MySQL server "*****". Check that the server…

Excel使用IF{1,0}虚拟数组+VLOOKUP实现联合查询.220507

以此案例举例:使用IF({1,0})建立虚拟数据的方法,整体输入的公式是: =VLOOKUP(E2&F2,IF({1,0},A:A&B:B,C:C),2,0) 输入完公式之后,需要按CTRL+shift+enter键 使用if({1,0},A:A&B:B,C:C)来构建了一个不需要辅助列的虚拟数组。 Excel 中ctrl+enter和ctrl+shift+en…

C++从入门到精通(第6版)PDF、EPUB免费下载

《C++从入门到精通(第6版)》从初学者角度出发,以通俗易懂的语言和丰富多彩的实例,详细讲解了C++程序开发需要掌握的知识。本书分为4篇共19章:第1篇是基础知识,包括绪论,数据类型,运算符与表达式,条件判断语句,循环语句,函数,数组、指针和引用,以及构造数据类型;第…

C# typeof()实例详解

原文链接:https://www.cnblogs.com/ybqjymy/p/12902845.html 用于获取类型的 System.Type 对象。typeof 表达式采用以下形式:System.Type type = typeof(int); 备注若要获取表达式的运行时类型,可以使用 .NET Framework 方法 GetType,如下所示:1 int i = 0; 2 System.Type…

PhpStorm 2024.3.1.1 安装激活教程(激活至2026,实际上永久,亲测!)以及常见问题处理

申明:本教程 PhpStorm 补丁、激活码均收集于网络,请勿商用,仅供个人学习使用,如有侵权,请联系作者删除。若条件允许,希望大家购买正版 !卸载老版本 PhpStorm 首先,如果小伙伴的电脑上有安装老版本的 PhpStorm , 需要将其彻底卸载掉,如下所示(没有安装则不用管,直…

以太网物理层IOP测试设备TESTBASE-EIOP

OPEN联盟(OPEN Alliance)是一个由OEM、Tier1和Tier2共同组建的非盈利开放性的行业联盟,旨在将以太网技术在汽车环境中应用及推广,TESTBASE-EIOP是经纬恒润自主研发的车载以太网物理层IOP(交互性)自动化测试设备,可完整覆盖OPEN TC8 IOP测试标准。背景OPEN联盟(OPEN All…

Linux命令行连接蓝牙设备

Linux命令行连接蓝牙设备 查看Bluetooth设备: hciconfig启动一个Bluetooth设备,例如:hci0: hciconfig hci0 up相关指令查看特定的Bluetooth设备(例如,设备名为hci0): hciconfig hci0关闭一个Bluetooth设备(例如,设备名为hci0): hciconfig hci0 down修改一个Bluetoot…

华为云专家说:开源的商业化之路与开发者技术服务

开源在大量在云技术以及业务中应用,从开源与云的增长模式看,开源与云具有相当程度的相似性。本文来源:《华为云DTSE》第五期开源专刊,作者:华为云开发者支持首席布道师汪盛 开源、云的增长模式与 Product Led Growth具有较大相似性,两者增长立足于产品质量与使用的开发者…

JAVA-Day 06:if语句的三种形式

if语句的三种形式if(表达式){语句体}如果小括号里的表达式结果为真,则执行大括号中的语句体,如下图例子所示:2.if(表达式){语句体}else{语句体} 如果小括号里的表达式为真,则执行else前的大括号中的语句体,如果小括号里的表达式为假,则执行else后的大括号中的语句体。如下图…