zipnerf-pytorch
zipnerf-pytorch copied to clipboard
Installation problem
Guys, I'm having a lot of problems trying to execute the train.py file.
OS: Ubuntu 22.04 Graphics card: RTX 3060 Driver version: 545.29.06
I installed cuda 11.8 and configured bashrc accondingly:
export PATH=/usr/local/cuda-11.8/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH
The output of nvcc --version
command is:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0
Then I followed these steps:
$ # Clone the repo.
$ git clone https://github.com/SuLvXiangXin/zipnerf-pytorch.git
$ cd zipnerf-pytorch
$ # Make a conda environment.
$ conda create --name zipnerf python=3.9
$ conda activate zipnerf
$ # Install requirements.
$ pip install -r requirements.txt
These are the packages installed after running pip install -r requirements.txt
:
_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 2_gnu conda-forge
absl-py 2.1.0 pypi_0 pypi
accelerate 0.31.0 pypi_0 pypi
asttokens 2.4.1 pypi_0 pypi
bzip2 1.0.8 hd590300_5 conda-forge
ca-certificates 2024.6.2 hbcca054_0 conda-forge
certifi 2024.6.2 pypi_0 pypi
charset-normalizer 3.3.2 pypi_0 pypi
contourpy 1.2.1 pypi_0 pypi
cycler 0.12.1 pypi_0 pypi
decorator 5.1.1 pypi_0 pypi
exceptiongroup 1.2.1 pypi_0 pypi
executing 2.0.1 pypi_0 pypi
filelock 3.15.4 pypi_0 pypi
fonttools 4.53.0 pypi_0 pypi
fsspec 2024.6.0 pypi_0 pypi
gin-config 0.5.0 pypi_0 pypi
grpcio 1.64.1 pypi_0 pypi
huggingface-hub 0.23.4 pypi_0 pypi
idna 3.7 pypi_0 pypi
imageio 2.34.2 pypi_0 pypi
imageio-ffmpeg 0.5.1 pypi_0 pypi
importlib-metadata 8.0.0 pypi_0 pypi
importlib-resources 6.4.0 pypi_0 pypi
ipython 8.18.1 pypi_0 pypi
jedi 0.19.1 pypi_0 pypi
jinja2 3.1.4 pypi_0 pypi
joblib 1.4.2 pypi_0 pypi
kiwisolver 1.4.5 pypi_0 pypi
lazy-loader 0.4 pypi_0 pypi
ld_impl_linux-64 2.40 hf3520f5_7 conda-forge
libffi 3.4.2 h7f98852_5 conda-forge
libgcc-ng 13.2.0 h77fa898_13 conda-forge
libgomp 13.2.0 h77fa898_13 conda-forge
libnsl 2.0.1 hd590300_0 conda-forge
libsqlite 3.46.0 hde9e2c9_0 conda-forge
libuuid 2.38.1 h0b41bf4_0 conda-forge
libxcrypt 4.4.36 hd590300_1 conda-forge
libzlib 1.3.1 h4ab18f5_1 conda-forge
markdown 3.6 pypi_0 pypi
markupsafe 2.1.5 pypi_0 pypi
matplotlib 3.9.0 pypi_0 pypi
matplotlib-inline 0.1.7 pypi_0 pypi
mediapy 1.2.2 pypi_0 pypi
mpmath 1.3.0 pypi_0 pypi
ncurses 6.5 h59595ed_0 conda-forge
networkx 3.2.1 pypi_0 pypi
ninja 1.11.1.1 pypi_0 pypi
numpy 2.0.0 pypi_0 pypi
nvidia-cublas-cu12 12.1.3.1 pypi_0 pypi
nvidia-cuda-cupti-cu12 12.1.105 pypi_0 pypi
nvidia-cuda-nvrtc-cu12 12.1.105 pypi_0 pypi
nvidia-cuda-runtime-cu12 12.1.105 pypi_0 pypi
nvidia-cudnn-cu12 8.9.2.26 pypi_0 pypi
nvidia-cufft-cu12 11.0.2.54 pypi_0 pypi
nvidia-curand-cu12 10.3.2.106 pypi_0 pypi
nvidia-cusolver-cu12 11.4.5.107 pypi_0 pypi
nvidia-cusparse-cu12 12.1.0.106 pypi_0 pypi
nvidia-nccl-cu12 2.20.5 pypi_0 pypi
nvidia-nvjitlink-cu12 12.5.40 pypi_0 pypi
nvidia-nvtx-cu12 12.1.105 pypi_0 pypi
opencv-contrib-python 4.10.0.84 pypi_0 pypi
opencv-python 4.10.0.84 pypi_0 pypi
openssl 3.3.1 h4ab18f5_1 conda-forge
packaging 24.1 pypi_0 pypi
parso 0.8.4 pypi_0 pypi
pexpect 4.9.0 pypi_0 pypi
pillow 10.3.0 pypi_0 pypi
pip 24.0 pyhd8ed1ab_0 conda-forge
plyfile 1.0.3 pypi_0 pypi
prompt-toolkit 3.0.47 pypi_0 pypi
protobuf 4.25.3 pypi_0 pypi
psutil 6.0.0 pypi_0 pypi
ptyprocess 0.7.0 pypi_0 pypi
pure-eval 0.2.2 pypi_0 pypi
pygments 2.18.0 pypi_0 pypi
pymeshlab 2023.12.post1 pypi_0 pypi
pyparsing 3.1.2 pypi_0 pypi
python 3.9.19 h0755675_0_cpython conda-forge
python-dateutil 2.9.0.post0 pypi_0 pypi
pyyaml 6.0.1 pypi_0 pypi
rawpy 0.22.0 pypi_0 pypi
readline 8.2 h8228510_1 conda-forge
requests 2.32.3 pypi_0 pypi
safetensors 0.4.3 pypi_0 pypi
scikit-image 0.24.0 pypi_0 pypi
scikit-learn 1.5.0 pypi_0 pypi
scipy 1.13.1 pypi_0 pypi
setuptools 70.1.1 pyhd8ed1ab_0 conda-forge
six 1.16.0 pypi_0 pypi
stack-data 0.6.3 pypi_0 pypi
sympy 1.12.1 pypi_0 pypi
tensorboard 2.17.0 pypi_0 pypi
tensorboard-data-server 0.7.2 pypi_0 pypi
tensorboardx 2.6.2.2 pypi_0 pypi
threadpoolctl 3.5.0 pypi_0 pypi
tifffile 2024.6.18 pypi_0 pypi
tk 8.6.13 noxft_h4845f30_101 conda-forge
torch 2.3.1 pypi_0 pypi
tqdm 4.66.4 pypi_0 pypi
traitlets 5.14.3 pypi_0 pypi
trimesh 4.4.1 pypi_0 pypi
triton 2.3.1 pypi_0 pypi
typing-extensions 4.12.2 pypi_0 pypi
tzdata 2024a h0c530f3_0 conda-forge
urllib3 2.2.2 pypi_0 pypi
wcwidth 0.2.13 pypi_0 pypi
werkzeug 3.0.3 pypi_0 pypi
wheel 0.43.0 pyhd8ed1ab_1 conda-forge
xatlas 0.0.9 pypi_0 pypi
xz 5.2.6 h166bdaf_0 conda-forge
zipp 3.19.2 pypi_0 pypi
The first problem arises when I try to run the following command:
$ pip install ./extensions/cuda
The output is:
The detected CUDA version (11.8) mismatches the version that was used to compile
PyTorch (12.1). Please make sure to use the same CUDA versions.
It happens because the torch installed from the requirements.txt uses cuda 12.1:
$ python -c "import torch; print(torch.version.cuda)"
12.1
Therefore, I changed the cuda version for 12.1 in bashrc:
export PATH=/usr/local/cuda-12.1/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64:$LD_LIBRARY_PATH
The g++ version is:
g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Even after changing the cuda version, I get a lot of errors: extension_cuda.log
I then uninstalled ninja:
pip uninstall ninja
And changed the string -std=c++14
to -std=c++17
in the extension/cuda/setup.py
.
After this change, everything compiles:
(zipnerf) caio@caio:~/2_company/OmniverseGaussianSplatIsaacSimProject/splats_folders/zipnerf-pytorch$ python -m pip install ./extensions/cuda
Processing ./extensions/cuda
Preparing metadata (setup.py) ... done
Building wheels for collected packages: cuda_backend
Building wheel for cuda_backend (setup.py) ... done
Created wheel for cuda_backend: filename=cuda_backend-0.0.0-cp39-cp39-linux_x86_64.whl size=3176457 sha256=f9076cdabe55877cebfc06f06e4b2258980dbaf3012d27fd26e3f6c6d445e421
Stored in directory: /tmp/pip-ephem-wheel-cache-jw40zyr5/wheels/af/21/ed/afe122eadd56c6f1f7a8fefee691e9ef1def176f5abb977063
Successfully built cuda_backend
Installing collected packages: cuda_backend
Successfully installed cuda_backend-0.0.0
Finally, I tried to install torch-scatter for CUDA 12.1 and torch 2.3.1 (version installed from the requirements.txt)
$ pip install torch-scatter -f https://data.pyg.org/whl/torch-2.1.0+cu121.html
When I try to run the train.py script with the bycicle dataset I get:
(base) (base) caio@caio:~/2_company/OmniverseGaussianSplatIsaacSimProject/splats_folders/zipnerf-pytorch$ /home/caio/anaconda3/envs/zipnerf/bin/python /home/caio/2_company/OmniverseGaussianSplatIsaacSimProject/splats_folders/zipnerf-pytorch/train.py
Traceback (most recent call last):
File "/home/caio/2_company/OmniverseGaussianSplatIsaacSimProject/splats_folders/zipnerf-pytorch/train.py", line 15, in <module>
from internal import datasets
File "/home/caio/2_company/OmniverseGaussianSplatIsaacSimProject/splats_folders/zipnerf-pytorch/internal/datasets.py", line 22, in <module>
from .pycolmap import pycolmap
File "/home/caio/2_company/OmniverseGaussianSplatIsaacSimProject/splats_folders/zipnerf-pytorch/internal/pycolmap/pycolmap/__init__.py", line 4, in <module>
from .scene_manager import SceneManager
File "/home/caio/2_company/OmniverseGaussianSplatIsaacSimProject/splats_folders/zipnerf-pytorch/internal/pycolmap/pycolmap/scene_manager.py", line 21, in <module>
class SceneManager:
File "/home/caio/2_company/OmniverseGaussianSplatIsaacSimProject/splats_folders/zipnerf-pytorch/internal/pycolmap/pycolmap/scene_manager.py", line 22, in SceneManager
INVALID_POINT3D = np.uint64(-1)
OverflowError: Python integer -1 out of bounds for uint64
Any thoughts on how to solve it? Thank you very much :)