Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Python 3.8, suggest 3.10 by default #3527

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/core_code_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8.13
- name: Set up Python 3.10.15
uses: actions/setup-python@v4
with:
python-version: '3.8.13'
python-version: '3.10.15'
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.8'
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install build twine
Expand Down
20 changes: 10 additions & 10 deletions docs/quickstart/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
::::::{tab-set}
:::::{tab-item} Linux

Nerfstudio requires `python >= 3.8`. We recommend using conda to manage dependencies. Make sure to install [Conda](https://docs.conda.io/en/latest/miniconda.html) before proceeding.
Nerfstudio requires `python >= 3.9`. We recommend using conda to manage dependencies. Make sure to install [Conda](https://docs.conda.io/en/latest/miniconda.html) before proceeding.

:::::
:::::{tab-item} Windows

:::{admonition} Note
:class: info
Nerfstudio on Windows is less tested and more fragile, due to way more moving parts outside of Nerfstudio's control.
The instructions also tend to break over time as updates to different Windows packages happen.
Installing Nerfstudio on Linux instead is recommended if you have the option.
Nerfstudio on Windows is less tested and more fragile, due to way more moving parts outside of Nerfstudio's control.
The instructions also tend to break over time as updates to different Windows packages happen.
Installing Nerfstudio on Linux instead is recommended if you have the option.
Alternatively, installing Nerfstudio under WSL2 (temporary unofficial guide [here](https://gist.github.com/SharkWipf/0a3fc1be3ea88b0c9640db6ce15b44b9), not guaranteed to work) is also an option, but this comes with its own set of caveats.
:::

Expand Down Expand Up @@ -51,15 +51,15 @@ For example:
When updating, or if you close your terminal before you finish the installation and run your first `splatfacto`, you have to re-do this environment activation step.
:::

Nerfstudio requires `python >= 3.8`. We recommend using conda to manage dependencies. Make sure to install [Conda](https://docs.conda.io/en/latest/miniconda.html) before proceeding.
Nerfstudio requires `python >= 3.9`. We recommend using conda to manage dependencies. Make sure to install [Conda](https://docs.conda.io/en/latest/miniconda.html) before proceeding.

:::::
::::::

## Create environment

```bash
conda create --name nerfstudio -y python=3.8
conda create --name nerfstudio -y python=3.10
conda activate nerfstudio
python -m pip install --upgrade pip

Expand Down Expand Up @@ -184,15 +184,15 @@ TLDR for linux:
curl -fsSL https://pixi.sh/install.sh | bash
```

### Install Pixi Environmnent
### Install Pixi Environmnent
After Pixi is installed, you can run
```bash
git clone https://github.com/nerfstudio-project/nerfstudio.git
cd nerfstudio
pixi run post-install
pixi shell
```
This will fetch the latest Nerfstudio code, install all enviroment dependencies including colmap, tinycudann and hloc, and then activate the pixi environment (similar to conda).
This will fetch the latest Nerfstudio code, install all enviroment dependencies including colmap, tinycudann and hloc, and then activate the pixi environment (similar to conda).
From now on, each time you want to run Nerfstudio in a new shell, you have to navigate to the nerfstudio folder and run `pixi shell` again.

You could also run
Expand Down Expand Up @@ -435,6 +435,6 @@ export PATH=$PATH:$CUDA_HOME/bin

**Other errors**

(Windows) A lot of errors on Windows can be caused by not having the Visual Studio environment loaded.
If you run into errors you can't figure out, please try re-activating the Visual Studio environment (as outlined at the top of the Windows instructions on this page) and try again.
(Windows) A lot of errors on Windows can be caused by not having the Visual Studio environment loaded.
If you run into errors you can't figure out, please try re-activating the Visual Studio environment (as outlined at the top of the Windows instructions on this page) and try again.
This activation only lasts within your current terminal session and does not extend to other terminals, but this should only be needed on first run and on updates.
7 changes: 4 additions & 3 deletions nerfstudio/scripts/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ def _render_trajectory_video(
max_idx = true_max_idx

if crop_data is not None:
with renderers.background_color_override_context(
crop_data.background_color.to(pipeline.device)
), torch.no_grad():
with (
renderers.background_color_override_context(crop_data.background_color.to(pipeline.device)),
torch.no_grad(),
):
outputs = pipeline.model.get_outputs_for_camera(
cameras[camera_idx : camera_idx + 1], obb_box=obb_box
)
Expand Down
8 changes: 5 additions & 3 deletions nerfstudio/viewer/render_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ def _render_img(self, camera_state: CameraState):
[color[0] / 255.0, color[1] / 255.0, color[2] / 255.0],
device=self.viewer.get_model().device,
)
with background_color_override_context(
background_color
), torch.no_grad(), viewer_utils.SetTrace(self.check_interrupt):
with (
background_color_override_context(background_color),
torch.no_grad(),
viewer_utils.SetTrace(self.check_interrupt),
):
outputs = self.viewer.get_model().get_outputs_for_camera(camera, obb_box=obb)
else:
with torch.no_grad(), viewer_utils.SetTrace(self.check_interrupt):
Expand Down
2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ train-example-nerf = {cmd="ns-train nerfacto --data data/nerfstudio/dozer/", dep


[dependencies]
python = ">=3.8,<3.11"
python = ">=3.9,<3.11"
pip = ">=24.0,<25"
cuda = {version = "*", channel="nvidia/label/cuda-11.8.0"}
pytorch-cuda = {version = "11.8.*", channel="pytorch"}
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version = "1.1.5"
description = "All-in-one repository for state-of-the-art NeRFs"
readme = "README.md"
license = { text="Apache 2.0"}
requires-python = ">=3.8.0"
requires-python = ">=3.9.0"
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python",
Expand Down Expand Up @@ -39,9 +39,7 @@ dependencies = [
"protobuf<=3.20.3,!=3.20.0",
# TODO(1480) enable when pycolmap windows wheels are available
# "pycolmap==0.3.0",
# TODO(3461) and external issue cnr-isti-vclab/PyMeshLab/issues/398: Unrestrict Windows version when it isn't broken anymore.
"pymeshlab>=2022.2.post2; platform_machine != 'arm64' and platform_machine != 'aarch64'",
"pymeshlab<2023.12.post2; sys_platform == 'win32' and platform_machine != 'arm64' and platform_machine != 'aarch64'",
"pyngrok>=5.1.0",
"python-socketio>=5.7.1",
"pyquaternion>=0.9.9",
Expand Down Expand Up @@ -162,7 +160,7 @@ reportMissingImports = "warning"
reportMissingTypeStubs = false
reportPrivateImportUsage = false

pythonVersion = "3.8"
pythonVersion = "3.10"
pythonPlatform = "Linux"

[tool.ruff]
Expand Down
Loading