tangjiapeng / DiffuScene

[CVPR 2024] DiffuScene: Denoising Diffusion Models for Generative Indoor Scene Synthesis
Other
188 stars 15 forks source link

Installation Failing #1

Closed dv-fenix closed 1 year ago

dv-fenix commented 1 year ago

Hi! I ran into some issues while trying to setup the environment as per the instructions provided on the repo. Initially, the build for the conda environment failed with the following error:

Could not solve for environment specs
The following package could not be installed
└─ trimesh 3.12.7**  does not exist (perhaps a typo or a missing channel).

and after removing trimesh 3.12.7 from the .yaml file,

Pip subprocess error:
ERROR: Could not find a version that satisfies the requirement plyfile==1.21.3 (from versions: 0.4, 0.5, 0.6, 0.7, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.8, 0.8.1, 0.9)
ERROR: No matching distribution found for plyfile==1.21.3

failed

CondaEnvException: Pip failed

I found that trimesh is pip installable, and the latest stable release of plyfile is automatically installed as a dependency for one of the other packages. Hence, the following environment.yaml file fixes the build:

name: diffuscene
channels:
  - conda-forge
  - pytorch
  - defaults
dependencies:
  - cython=0.29.32
  - numpy=1.21.3
  - networkx=2.5.1
  - pyrr=0.10.3
  - pyyaml=5.3.1
  - python=3.8
  - cudatoolkit=11.3
  - pytorch=1.13.0
  - torchvision=0.14.0
  - pillow=7.2.0
  - scipy=1.8.1
  - tqdm=4.64.1
  - matplotlib=3.3.1
  - wxpython=4.0.7
  - pip:
    - simple_3dviz==0.7.0
    - pytorch-fast-transformers==0.4.0
    - wandb==0.13.2
    - open3d==0.15.2
    - seaborn==0.12.2
    - trimesh==3.12.7
    - num2words

But then the installation for ChamferDistancePytorch fails with the following traceback:

Traceback (most recent call last):
  File "setup.py", line 7, in <module>
    CUDAExtension('chamfer_3D', [
  File "/user/dv/miniconda3/envs/diffuscene/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1031, in CUDAExtension
    library_dirs += library_paths(cuda=True)
  File "/user/dv/miniconda3/envs/diffuscene/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1163, in library_paths
    if (not os.path.exists(_join_cuda_home(lib_dir)) and
  File "/user/dv/miniconda3/envs/diffuscene/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 2214, in _join_cuda_home
    raise EnvironmentError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.

Can you please help me figure out what's gone wrong?

dv-fenix commented 1 year ago

Hi @tangjiapeng, I was unable to resolve this issue. Can you help with this?

dv-fenix commented 1 year ago

I was finally able to set up the conda env for this project. For anyone who runs into similar issues, here is what I did:

# Create conda environment
mamba create --name diffuscene python=3.8

# Activate conda environment
mamba activate diffuscene

# Install pytorch 1.13.0, note that support for cuda 11.3 has been deprecated
mamba install pytorch==1.13.0 torchvision==0.14.0 torchaudio==0.13.0 pytorch-cuda=11.6 -c pytorch -c nvidia 

# Install pip dependencies
pip install cython
pip install networkx
pip install pyrr
pip install Pillow
pip install scipy
pip install tqdm
pip install matplotlib
pip install simple_3dviz
pip install pytorch-fast-transformers
pip install open3d
pip install seaborn
pip install num2words

# Setup extension modules
python setup.py build_ext --inplace
pip install -e .

# Set CUDA_HOME
export CUDA_HOME="<path_to_conda_env>"

# Install ChamferDistancePytorch
cd ChamferDistancePytorch/chamfer3D
python setup.py install

Note that I personally prefer using mamba over conda because it's so much faster. But in case you don't want to, you can simply replace mamba with conda everywhere.

Closing this issue now.

shanqiiu commented 10 months ago

Hello, @dv-fenix .Thank you for your message, I would like to ask you to run the training script has encountered the following situation: ModuleNotFoundError: No module named 'torchtext'

dv-fenix commented 9 months ago

Hi @shanqiiu I seem to have missed that in the environment file. Installing torchtext with pip was leading to some issues. Installing it with mamba worked for me.

You can use the following command to do so: mamba install torchtext==0.14.1 -c pytorch

Hope this helps!