mobile wallpaper 1mobile wallpaper 2mobile wallpaper 3mobile wallpaper 4mobile wallpaper 5mobile wallpaper 6
196 字
1 分钟
fruitNeRF++训练笔记
2026-04-24

第一步:确认文件夹#

文件这样放:

FruitNeRF_Real/
├── real_tree_1/
│ ├── images/
│ └── transforms.json
├── real_tree_2/
│ ├── images/
│ └── transforms.json
└── real_tree_3/
├── images/
└── transforms.json

如果有semantics文件夹可以放进去,如果没有的话就要训练了。(权重文件要下载好)

第二步:训练#

ns-train fruit_nerf --data D:\Project\FruitNeRF++\dataset\FruitNeRF_Real\FruitNeRF_Dataset\tree_01 --output-dir D:\Project\FruitNeRF++\outputs\tree1 --vis tensorboard --steps-per-eval-image 999999 --steps-per-eval-all-images 999999 --pipeline.datamanager.train-num-images-to-sample-from 50

第三步:生成点云图#

ns-export-semantics semantic-pointcloud --load-config "D:\Project\FruitNeRF++\outputs\apple_small\01_apple_tree_1024x1024_#300_SAM\fruit_nerf\2026-04-24_141138\config.yml" --output-dir "D:\Project\FruitNeRF++\outputs\apple_small\pointcloud" --use-bounding-box True --bounding-box-min -1 -1 -1 --bounding-box-max 1 1 1 --num-rays-per-batch 2000 --num-points-per-side 1000

第四步:计数(暂时失效)#

问题#

AttributeError: module ‘torch’ has no attribute ‘xpu’#

diffusers 版本太新了,你之前装 GroundingSAM 时执行了 pip install --upgrade diffusers[torch],把它升到了最新版(0.27+),但 PyTorch 2.1.2 没有 torch.xpu 属性,直接导入就炸 。

RuntimeError: [enforce fail at alloc_cpu.cpp:80] data. DefaultCPUAllocator: not enough memory: you tried to allocate 89568000000 bytes.#

内存炸了! 311 张真实照片,nerfstudio 1.1.5 默认把全部图片的 rays 缓存到 CPU 内存,直接爆了 83 GB。

最快的解法:限制缓存图片数量

ns-train fruit_nerf --data D:\Project\FruitNeRF++\dataset\FruitNeRF_Real\FruitNeRF_Dataset\tree_01 --output-dir D:\Project\FruitNeRF++\outputs\tree1 --vis tensorboard --steps-per-eval-image 999999 --steps-per-eval-all-images 999999 --pipeline.datamanager.train-num-images-to-sample-from 50
分享

如果这篇文章对你有帮助,欢迎分享给更多人!

fruitNeRF++训练笔记
https://fredsblog-2dc.pages.dev/posts/guide-fruitnerf-train/
作者
Fredzhe
发布于
2026-04-24
许可协议
CC BY-NC-SA 4.0

部分信息可能已经过时