mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-06 07:48:50 +08:00
1 parent
af58b32cc8
commit
3d7abf5a4d
5 files changed
+74
-54
No files matched your search
@@ -83,23 +83,33 @@ After placing your new `Config` class into the `model_configs` dictionary, you c
|
|||||||
### Modifying from CLI
|
### Modifying from CLI
|
||||||
Often times, you just want to play with the parameters of an existing model without having to specify a new one. You can easily do so via CLI. Below, we showcase some useful CLI commands.
|
Often times, you just want to play with the parameters of an existing model without having to specify a new one. You can easily do so via CLI. Below, we showcase some useful CLI commands.
|
||||||
|
|
||||||
```bash
|
- List out all existing models
|
||||||
# list out all existing models
|
```bash
|
||||||
ns-train --help
|
ns-train --help
|
||||||
|
```
|
||||||
|
|
||||||
# list out all exist configurable parameters for {MODEL_NAME}
|
- List out all exist configurable parameters for `{MODEL_NAME}`
|
||||||
ns-train {MODEL_NAME} --help
|
```bash
|
||||||
|
ns-train {MODEL_NAME} --help
|
||||||
|
```
|
||||||
|
|
||||||
# change the train/eval dataset
|
- Change the train/eval dataset
|
||||||
ns-train {MODEL_NAME} --data DATA_PATH
|
```bash
|
||||||
|
ns-train {MODEL_NAME} --data DATA_PATH
|
||||||
|
```
|
||||||
|
|
||||||
# enable the viewer
|
- Enable the viewer
|
||||||
ns-train {MODEL_NAME} --vis viewer
|
```bash
|
||||||
|
ns-train {MODEL_NAME} --vis viewer
|
||||||
|
```
|
||||||
|
|
||||||
# see what options are available for the specified dataparser (e.g. blender-data)
|
- See what options are available for the specified dataparser (e.g. blender-data)
|
||||||
ns-train {MODEL_NAME} {DATA_PARSER} --help
|
```bash
|
||||||
|
ns-train {MODEL_NAME} {DATA_PARSER} --help
|
||||||
|
```
|
||||||
|
|
||||||
# run with changed dataparser attributes and viewer on
|
- Run with changed dataparser attributes and viewer on
|
||||||
# NOTE: the dataparser and associated configurations go at the end of the command
|
```bash
|
||||||
ns-train {MODEL_NAME} --vis viewer {DATA_PARSER} --scale-factor 0.5
|
# NOTE: the dataparser and associated configurations go at the end of the command
|
||||||
```
|
ns-train {MODEL_NAME} --vis viewer {DATA_PARSER} --scale-factor 0.5
|
||||||
|
```
|
||||||
@@ -26,14 +26,15 @@ To view all the arguments and annotations, you can run `./scripts/benchmarking/l
|
|||||||
|
|
||||||
A full example would be:
|
A full example would be:
|
||||||
|
|
||||||
```bash
|
- With `-g` specifying gpus
|
||||||
|
```bash
|
||||||
|
./scripts/benchmarking/launch_train_blender.sh -m nerfacto -g 0 1 2 3
|
||||||
|
```
|
||||||
|
|
||||||
# with -g specifying gpus
|
- Without `-g` automatically finds available gpus
|
||||||
./scripts/benchmarking/launch_train_blender.sh -m nerfacto -g 0 1 2 3
|
```bash
|
||||||
|
./scripts/benchmarking/launch_train_blender.sh -m nerfacto
|
||||||
# without -g automatically finds available gpus
|
```
|
||||||
./scripts/benchmarking/launch_train_blender.sh -m nerfacto
|
|
||||||
```
|
|
||||||
|
|
||||||
The script will automatically launch training on all of the items and save the checkpoints in an output directory with the experiment name and current timestamp.
|
The script will automatically launch training on all of the items and save the checkpoints in an output directory with the experiment name and current timestamp.
|
||||||
|
|
||||||
|
|||||||
@@ -2,28 +2,26 @@
|
|||||||
|
|
||||||
The `LocalWriter` simply outputs numerical stats to the terminal.
|
The `LocalWriter` simply outputs numerical stats to the terminal.
|
||||||
You can specify additional parameters to customize your logging experience.
|
You can specify additional parameters to customize your logging experience.
|
||||||
|
A skeleton of the local writer config is defined below.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
"""nerfstudio/configs/base_config.py""""
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class LocalWriterConfig(InstantiateConfig):
|
class LocalWriterConfig(InstantiateConfig):
|
||||||
"""Local Writer config"""
|
"""Local Writer config"""
|
||||||
|
|
||||||
_target: Type = writer.LocalWriter
|
_target: Type = writer.LocalWriter
|
||||||
"""target class to instantiate"""
|
|
||||||
enable: bool = False
|
enable: bool = False
|
||||||
"""if True enables local logging, else disables"""
|
|
||||||
stats_to_track: Tuple[writer.EventName, ...] = (
|
stats_to_track: Tuple[writer.EventName, ...] = (
|
||||||
writer.EventName.ITER_TRAIN_TIME,
|
writer.EventName.ITER_TRAIN_TIME,
|
||||||
writer.EventName.TRAIN_RAYS_PER_SEC,
|
...
|
||||||
writer.EventName.CURR_TEST_PSNR,
|
|
||||||
writer.EventName.VIS_RAYS_PER_SEC,
|
|
||||||
writer.EventName.TEST_RAYS_PER_SEC,
|
|
||||||
)
|
)
|
||||||
"""specifies which stats will be logged/printed to terminal"""
|
|
||||||
max_log_size: int = 10
|
max_log_size: int = 10
|
||||||
"""maximum number of rows to print before wrapping. if 0, will print everything."""
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can customize the local writer by editing the attributes:
|
||||||
- `enable`: enable/disable the logger.
|
- `enable`: enable/disable the logger.
|
||||||
- `stats_to_track`: all the stats that you want to print to the terminal (see list under `EventName` in `utils/writer.py`). You can add or remove any of the defined enums.
|
- `stats_to_track`: all the stats that you want to print to the terminal (see list under `EventName` in `utils/writer.py`). You can add or remove any of the defined enums.
|
||||||
- `max_log_size`: how much content to print onto the screen (By default, only print 10 lines onto the screen at a time). If 0, will print everything without deleting any previous lines.
|
- `max_log_size`: how much content to print onto the screen (By default, only print 10 lines onto the screen at a time). If 0, will print everything without deleting any previous lines.
|
||||||
@@ -39,10 +37,12 @@ If you want to create a new stat to track, simply add the stat name to the `Even
|
|||||||
The local writer is easily configurable via CLI.
|
The local writer is easily configurable via CLI.
|
||||||
A few common commands to use:
|
A few common commands to use:
|
||||||
|
|
||||||
```bash
|
- Disable local writer
|
||||||
# disable local writer
|
```bash
|
||||||
ns-train {METHOD_NAME} --logging.local-writer.no-enable
|
ns-train {METHOD_NAME} --logging.local-writer.no-enable
|
||||||
|
```
|
||||||
|
|
||||||
# disable line wrapping
|
- Disable line wrapping
|
||||||
ns-train {METHOD_NAME} --logging.local-writer.max-log-size=0
|
```bash
|
||||||
```
|
ns-train {METHOD_NAME} --logging.local-writer.max-log-size=0
|
||||||
|
```
|
||||||
@@ -44,16 +44,16 @@ pip install py-spy
|
|||||||
|
|
||||||
To perform the profiling, you can either specify that you want to generate a flame graph or generate a live-view of the profiler.
|
To perform the profiling, you can either specify that you want to generate a flame graph or generate a live-view of the profiler.
|
||||||
|
|
||||||
```bash
|
- flame graph: with wandb logging and our inhouse logging disabled
|
||||||
## flame graph: with wandb logging and our inhouse logging disabled
|
```bash
|
||||||
program="ns-train nerfacto -- --vis=wandb --logging.no-enable-profiler blender-data"
|
program="ns-train nerfacto -- --vis=wandb --logging.no-enable-profiler blender-data"
|
||||||
py-spy record -o {PATH_TO_OUTPUT_SVG} $program
|
py-spy record -o {PATH_TO_OUTPUT_SVG} $program
|
||||||
```
|
```
|
||||||
|
- top-down stats: running same program configuration as above
|
||||||
```bash
|
```bash
|
||||||
## top-down stats: running same program configuration as above
|
py-spy top $program
|
||||||
py-spy top $program
|
```
|
||||||
```
|
|
||||||
:::{admonition} Attention
|
:::{admonition} Attention
|
||||||
:class: attention
|
:class: attention
|
||||||
|
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/to
|
|||||||
|
|
||||||
## Installing nerfstudio
|
## Installing nerfstudio
|
||||||
|
|
||||||
Pip package:
|
**From pip**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install nerfstudio
|
pip install nerfstudio
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want the latest and greatest:
|
**From source**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone git@github.com:nerfstudio-project/nerfstudio.git
|
git clone git@github.com:nerfstudio-project/nerfstudio.git
|
||||||
@@ -38,9 +38,12 @@ pip install -e .
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Optional
|
:::{admonition} Note
|
||||||
|
:class: info
|
||||||
|
Below are optional installations, but makes developing with nerfstudio much more convenient.
|
||||||
|
:::
|
||||||
|
|
||||||
#### Tab completion (bash & zsh)
|
**Tab completion (bash & zsh)**
|
||||||
|
|
||||||
This needs to be rerun when the CLI changes, for example if nerfstudio is updated.
|
This needs to be rerun when the CLI changes, for example if nerfstudio is updated.
|
||||||
|
|
||||||
@@ -48,7 +51,7 @@ This needs to be rerun when the CLI changes, for example if nerfstudio is update
|
|||||||
ns-install-cli
|
ns-install-cli
|
||||||
```
|
```
|
||||||
|
|
||||||
### Development packages
|
**Development packages**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install -e.[dev]
|
pip install -e.[dev]
|
||||||
@@ -61,9 +64,11 @@ pip install -e.[docs]
|
|||||||
- [Installation errors, File "setup.py" not found](pip-install-error)
|
- [Installation errors, File "setup.py" not found](pip-install-error)
|
||||||
- [Runtime errors, "len(sources) > 0".](cuda-sources-error)
|
- [Runtime errors, "len(sources) > 0".](cuda-sources-error)
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
(tiny-cuda-error)=
|
(tiny-cuda-error)=
|
||||||
|
|
||||||
#### TinyCUDA installation errors out with cuda mismatch
|
**TinyCUDA installation errors out with cuda mismatch**
|
||||||
|
|
||||||
While installing tiny-cuda, you run into: `The detected CUDA version mismatches the version that was used to compile PyTorch (10.2). Please make sure to use the same CUDA versions.`
|
While installing tiny-cuda, you run into: `The detected CUDA version mismatches the version that was used to compile PyTorch (10.2). Please make sure to use the same CUDA versions.`
|
||||||
|
|
||||||
@@ -73,9 +78,11 @@ While installing tiny-cuda, you run into: `The detected CUDA version mismatches
|
|||||||
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html
|
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
(pip-install-error)=
|
(pip-install-error)=
|
||||||
|
|
||||||
#### Installation errors, File "setup.py" not found
|
**Installation errors, File "setup.py" not found**
|
||||||
|
|
||||||
When installing dependencies and nerfstudio with `pip install -e .`, you run into: `ERROR: File "setup.py" not found. Directory cannot be installed in editable mode`
|
When installing dependencies and nerfstudio with `pip install -e .`, you run into: `ERROR: File "setup.py" not found. Directory cannot be installed in editable mode`
|
||||||
|
|
||||||
@@ -86,9 +93,11 @@ This can be fixed by upgrading pip to the latest version:
|
|||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
(cuda-sources-error)=
|
(cuda-sources-error)=
|
||||||
|
|
||||||
#### Runtime errors: "len(sources) > 0", "ctype = \_C.ContractionType(type.value) ; TypeError: 'NoneType' object is not callable".
|
**Runtime errors: "len(sources) > 0", "ctype = \_C.ContractionType(type.value) ; TypeError: 'NoneType' object is not callable".**
|
||||||
|
|
||||||
When running `train.py `, an error occurs when installing cuda files in the backend code.
|
When running `train.py `, an error occurs when installing cuda files in the backend code.
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user