neu-vi/HOI-Diff

Pointnet dependencies

kostasfnrs opened this issue · 3 comments

Hello, thank you for your research. I have some trouble when I am trying to install pointnet in order to train the affordance prediction module. How did you manage to use pointnet for your work? The official repo of pointnet is currently unmaintained. Thanks for your time

Hello, I also encountered trouble installing PointNet. I couldn't successfully configure it while using the HOI-Diff conda environment. Did you solve the problem? Thanks for your time.

Hi @fivezerojun. Start building the Pointnet first and then the hoi-diff on top of it. You can do the following:
First create an anaconda environment using Python 2.7:
conda create --name pointnet2_env python=2.7

Then install these versions of torch and torch vision with cuda11.7
pip install torch==1.13.0+cu117 torchvision==0.14.0+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
Ensure that the environment paths are correctly set to the CUDA toolkit you intend to use. If necessary, adjust your environment variables:
export PATH=/path/to/conda/envs/myenv/bin:$PATH (set your conda path)
export LD_LIBRARY_PATH=/path/to/conda/envs/myenv/lib:$LD_LIBRARY_PATH (set your conda path)

Install the correct g++ version supported by cuda11.7
conda install -c conda-forge gxx_linux-64=9.3.0

Set the Environment Variables:
export CXX=/path/to/conda/envs/pointnet2_env/bin/x86_64-conda-linux-gnu-g++
export CC=/path/to/conda/envs/pointnet2_env/bin/x86_64-conda-linux-gnu-gcc

Ensure the correct version of g++ is being used by your anaconda environment
First, identify the path to the g++ provided by your Conda environment:
which x86_64-conda-linux-gnu-g++
Export the CXX variable with the correct path:
export CXX=$(which x86_64-conda-linux-gnu-g++)
Verify the CXX version:
$CXX --version

Repeat the process for the CC environment variable:
export CC=$(which x86_64-conda-linux-gnu-gcc)
Verify the CC version:
$CC --version

If after all these you get an error indicating that the build process is failing due to a missing crypt.h header file, which is a part of the libxcrypt development package, do the following

conda install -c conda-forge libxcrypt

Make sure your environment variables are set correctly to point to the conda-installed compilers and include directories.
export CC=/miniconda3/envs/pointnet2_env/bin/x86_64-conda-linux-gnu-gcc
export CXX=
/miniconda3/envs/pointnet2_env/bin/x86_64-conda-linux-gnu-g++
export C_INCLUDE_PATH=/miniconda3/envs/pointnet2_env/include
export CPLUS_INCLUDE_PATH=
/miniconda3/envs/pointnet2_env/include

After installing the required package and setting the environment variables, try to install pointnet2-ops again:
pip install pointnet2-ops

You also need to install these required pip packages for hoi-diff:
pip install chumpy==0.70
freetype-py==2.4.0
future==1.0.0
imageio==2.34.0
networkx==3.1
numpy==1.23.1
pyglet==2.0.14
pyopengl==3.1.0
pyrender==0.1.45
pyyaml==6.0.1
scipy==1.10.1
six==1.16.0
smplx==0.1.28
torchgeometry==0.1.2
tqdm==4.66.2
trimesh==4.1.8

Thank you very much for your patient response. Following your instructions, I successfully configured the conda environment. Thanks again!