zju3dv / AutoRecon

Code for "AutoRecon: Automated 3D Object Discovery and Reconstruction" CVPR 2023 (Highlight)
Apache License 2.0
351 stars 15 forks source link

ERROR tinycudann_bindings #18

Open OliverV12 opened 9 months ago

OliverV12 commented 9 months ago

I was replicating your project and initially installed it with CUDA 12.3. Following your instructions, I set up the environment with Python 3.10 since the 'tiny-cuda' package wasn't available. The environment creation steps are as follows:

conda create --name auto_recon -y python=3.10 conda activate auto_recon python -m pip install --upgrade pip setuptools

Following your recommendations, I proceeded with the installation of AutoDecomp and I installed PyTorch using the following commands:

conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia

With these commands, I created an environment containing a different version of CUDA (11.7) compared to the system's CUDA (12.3). The installed version of PyTorch3D obtained from Anaconda Cloud using the command:

conda install pytorch3d -c pytorch3d

is:

pytorch3d 0.7.5 py310_cu117_pyt1131 pytorch3d

For the 'tiny-cuda' installation, I initially attempted the following command:

pip install git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch

However, the system reported an incompatibility between the CUDA version of 'tiny-cuda' and the system's CUDA version (12.3).

Upon further investigation on this issue at this link:

https://github.com/NVlabs/tiny-cuda-nn/issues/372

I discovered that it's possible to install 'tiny-cuda' with Python 3.10 and CUDA 11.7 (my Anaconda environment). I used the following command for installation:

pip install https://huggingface.co/camenduru/CoDeF/resolve/main/tinycudann-1.7-cp310-cp310-linux_x86_64.whl

This successfully installed 'tiny-cuda', after which I followed all other instructions to complete the project. However, upon running the command:

bash exps/code-release/run_pipeline_demo_low-res.sh

I encountered an error related to 'tinycuda_bindings':

Error executing job with overrides: ['data_root=data', 'inst_rel_dir=custom_data_example/co3d_chair', 'sparse_recon.n_images=40', 'sparse_recon.force_rerun=True', 'sparse_recon.n_feature_workers=1', 'sparse_recon.n_recon_workers=1', 'triangulation.force_rerun=True', 'triangulation.n_feature_workers=1', 'triangulation.n_recon_workers=1', 'dino_feature.force_extract=True', 'dino_feature.n_workers=1'] Traceback (most recent call last): File "/home/vicari/AutoRecon/third_party/AutoDecomp/auto_decomp/cli/inference_transformer.py", line 94, in main data: Dict[str, Any] = sfm_preprocess() File "/home/vicari/AutoRecon/third_party/AutoDecomp/auto_decomp/decomp/preprocess.py", line 288, in call return SfMPreprocessWorker(self.cfg, self.cfg.inst_rel_dir, device="cuda")() File "/home/vicari/AutoRecon/third_party/AutoDecomp/auto_decomp/decomp/preprocess.py", line 188, in call self.parse_poses(data) File "/home/vicari/AutoRecon/third_party/AutoDecomp/auto_decomp/decomp/preprocess.py", line 206, in parse_poses data.update({"poses": colmap_utils.parse_poses(self.rec)}) File "/home/vicari/AutoRecon/third_party/AutoDecomp/auto_decomp/utils/colmap.py", line 23, in parse_poses all_T44_w2c = read_extrinsics(rec) File "/home/vicari/AutoRecon/third_party/AutoDecomp/auto_decomp/utils/colmap.py", line 11, in read_extrinsics T44_w2c = np.concatenate([np.concatenate([img.rotmat(), img.tvec[:, None]], 1), bottom], 0) AttributeError: 'pycolmap.Image' object has no attribute 'rotmat' (pid=3830560) Extracting LoFTR matches: 0: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████| 410/410 [06:16<00:00, 1.74it/s] Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace. Traceback (most recent call last): File "/home/shared/anaconda3/envs/auto_recon/bin/ns-train", line 5, in from scripts.train import entrypoint File "/home/vicari/AutoRecon/scripts/train.py", line 50, in from nerfstudio.configs.method_configs import AnnotatedBaseConfigUnion File "/home/vicari/AutoRecon/nerfstudio/configs/method_configs.py", line 26, in from nerfstudio.configs.autorecon import method_configs as autorecon_method_configs File "/home/vicari/AutoRecon/nerfstudio/configs/autorecon/init.py", line 44, in from nerfstudio.fields.sdf_field import SDFFieldConfig File "/home/vicari/AutoRecon/nerfstudio/fields/sdf_field.py", line 42, in from nerfstudio.field_components.progressive_encoding import ProgressiveEncoding File "/home/vicari/AutoRecon/nerfstudio/field_components/progressive_encoding.py", line 5, in import tinycudann as tcnn File "/home/shared/anaconda3/envs/auto_recon/lib/python3.10/site-packages/tinycudann/init.py", line 9, in from tinycudann.modules import free_temporary_memory, NetworkWithInputEncoding, Network, Encoding File "/home/shared/anaconda3/envs/auto_recon/lib/python3.10/site-packages/tinycudann/modules.py", line 51, in _C = importlib.import_module(f"tinycudannbindings.{cc}_C") File "/home/shared/anaconda3/envs/auto_recon/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: /home/shared/anaconda3/envs/auto_recon/lib/python3.10/site-packages/tinycudann_bindings/_75_C.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN3c104cuda20CUDACachingAllocator9allocatorE

Could you provide insights into resolving this error?

Zeng-Fan-Yi commented 9 months ago

It seems that the error may appears here in AttributeError: 'pycolmap. Image' object has no attribute 'rotmat',This error is caused by a recent update to pycolmap, and I am also struggling with this error while running this project. If you find a solution, I hope you can communicate with me.