Closed Zevrap-81 closed 1 year ago
Hi, try to use following command to install pytorch3d
wget -O pytorch3d-0.4.0.zip https://github.com/facebookresearch/pytorch3d/archive/refs/tags/v0.4.0.zip
unzip pytorch3d-0.4.0.zip
cd pytorch3d-0.4.0 && python setup.py install && cd ..
Note that we do use pytorch3d whose version is 0.4.0 !
I think the requirements.txt itself was a conda environment format but somehow using conda to install it also doesn't work.. so I had to just run the program and install the missing packages one by one until the program can run. The pip requirements I exported is as follows (but some of the version numbers are specific to the remote instance that I'm using so you probably cannot just do pip install -r "filename.txt" with it).
appdirs==1.4.4
certifi==2021.10.8
charset-normalizer==3.1.0
click==8.1.3
cycler==0.11.0
docker-pycreds==0.4.0
einops==0.6.1
FastMinv==0.0.0
filterpy==1.4.5
fire==0.5.0
fonttools==4.31.2
fvcore==0.1.5.post20220305
gitdb==4.0.10
GitPython==3.1.31
h5py==3.6.0
idna==3.4
interplate==0.0.0
iopath==0.1.9
joblib==1.3.0
kiwisolver==1.4.0
matplotlib==3.5.1
MCGpu==0.0.0
mkl-fft==1.3.1
mkl-random @ file:///tmp/build/80754af9/mkl_random_1626186064646/work
mkl-service==2.4.0
numpy @ file:///tmp/build/80754af9/numpy_and_numpy_base_1634095647912/work
opencv-python==4.5.5.64
openmesh==1.2.1
packaging==21.3
pathtools==0.1.2
Pillow==9.0.1
portalocker==2.4.0
POT==0.9.0
protobuf==4.23.3
psutil==5.9.5
pycocotools==2.0.4
pyhocon==0.3.59
pymeshlab==2022.2.post4
pyparsing==2.4.7
python-dateutil==2.8.2
pytorch3d==0.4.0
PyYAML==6.0
requests==2.31.0
scikit-sparse==0.4.8
scipy==1.10.1
sentry-sdk==1.26.0
setproctitle==1.3.2
shapely==2.0.1
six @ file:///tmp/build/80754af9/six_1644875935023/work
smmap==5.0.0
smplpytorch==0.0.8
tabulate==0.8.9
termcolor==1.1.0
torch==1.10.2
torch-scatter==2.0.9
torchaudio==0.10.2
torchvision==0.11.3
tqdm==4.63.0
trimesh==3.10.5
typing-extensions @ file:///tmp/build/80754af9/typing_extensions_1631814937681/work
urllib3==2.0.3
wandb==0.15.4
yacs==0.1.8
I see that the problem is that there is a requirements.txt file and a environment.yml file. I followed Self Recon installation instructions and used environment.yml to install everything with ease.
Here are the steps that i followed to install the requirements
I installed cudatoolkit and pytorch in a conda enviroment. use python 3.8
conda create -n pytorch3d python=3.8
conda activate pytorch3d
conda install -c "nvidia/label/cuda-11.3.1" cuda-toolkit
pip install torch==1.10.2+cu113 torchvision==0.11.3+cu113 torchaudio==0.10.2 --extra-index-url https://download.pytorch.org/whl/cu113
I installed conda related modules using the environment.yml file but first i removed the pip dependencies from the file or you can copy the following into enviroment.yml file
channels:
- pytorch
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- _openmp_mutex=4.5=1_gnu
- blas=1.0=mkl
- bzip2=1.0.8=h7b6447c_0
- ca-certificates=2022.2.1=h06a4308_0
- certifi=2021.10.8=py38h06a4308_2
- ffmpeg=4.3=hf484d3e_0
- freetype=2.11.0=h70c0345_0
- giflib=5.2.1=h7b6447c_0
- gmp=6.2.1=h2531618_2
- gnutls=3.6.15=he1e5248_0
- intel-openmp=2021.4.0=h06a4308_3561
- jpeg=9d=h7f8727e_0
- lame=3.100=h7b6447c_0
- lcms2=2.12=h3be6417_0
- ld_impl_linux-64=2.35.1=h7274673_9
- libffi=3.3=he6710b0_2
- libgcc-ng=9.3.0=h5101ec6_17
- libgomp=9.3.0=h5101ec6_17
- libiconv=1.15=h63c8f33_5
- libidn2=2.3.2=h7f8727e_0
- libpng=1.6.37=hbc83047_0
- libstdcxx-ng=9.3.0=hd4cf53a_17
- libtasn1=4.16.0=h27cfd23_0
- libtiff=4.2.0=h85742a9_0
- libunistring=0.9.10=h27cfd23_0
- libuv=1.40.0=h7b6447c_0
- libwebp=1.2.2=h55f646e_0
- libwebp-base=1.2.2=h7f8727e_0
- lz4-c=1.9.3=h295c915_1
- mkl=2021.4.0=h06a4308_640
- mkl-service=2.4.0=py38h7f8727e_0
- mkl_fft=1.3.1=py38hd3c417c_0
- mkl_random=1.2.2=py38h51133e4_0
- ncurses=6.3=h7f8727e_2
- nettle=3.7.3=hbbd107a_1
- numpy=1.21.2=py38h20f2e39_0
- numpy-base=1.21.2=py38h79a1101_0
- openh264=2.1.1=h4ff587b_0
- openssl=1.1.1m=h7f8727e_0
- pillow=9.0.1=py38h22f2fdc_0
- pip=21.2.4=py38h06a4308_0
- readline=8.1.2=h7f8727e_1
- setuptools=58.0.4=py38h06a4308_0
- six=1.16.0=pyhd3eb1b0_1
- sqlite=3.38.0=hc218d9a_0
- tk=8.6.11=h1ccaba5_0
- typing_extensions=3.10.0.2=pyh06a4308_0
- wheel=0.37.1=pyhd3eb1b0_0
- xz=5.2.5=h7b6447c_0
- zlib=1.2.11=h7f8727e_4
- zstd=1.4.9=haebb681_0
and installed them using
conda env update -f environment.yml
then copy the following into requirements.txt file
cycler==0.11.0
fonttools==4.31.2
fvcore==0.1.5.post20220305
h5py==3.6.0
iopath==0.1.9
kiwisolver==1.4.0
matplotlib==3.5.1
opencv-python==4.5.5.64
openmesh==1.2.1
packaging==21.3
portalocker==2.4.0
pyhocon==0.3.59
pyparsing==2.4.7
python-dateutil==2.8.2
pyyaml==6.0
tabulate==0.8.9
termcolor==1.1.0
torch-scatter==2.0.9
tqdm==4.63.0
trimesh==3.10.5
yacs==0.1.8
pycocotools
cachetools
colorama
cython
gpustat
grpcio
icecream
idna
imageio
jinja2
networkx
ninja
pillow
pymcubes
pymeshlab
requests
rsa
scikit-image
shapely
tensorboard
torch_geometric
typing_extensions
urllib3
wandb
einops
POT # Anaconda Cloud
scikit-sparse
filterpy
fire
and install them using
pip install -r requirements.txt
Important!! use install.sh first to install all the submodules before you install pytorch3d
bash install.sh
Then I installed pytorch3d using the method listed in the readme.md file but first set the flag
export FORCE_CUDA=1
wget -O pytorch3d-0.4.0.zip https://github.com/facebookresearch/pytorch3d/archive/refs/tags/v0.4.0.zip
unzip pytorch3d-0.4.0.zip
cd pytorch3d-0.4.0 && pip install -e . && cd ..
I followed the instructions provided by @Zevrap-81, which were very clear and mostly worked. I wanted to provide some additional tips in case others run into the same problems I did:
I added conda install -c conda-forge gcc=10.3 gxx=10.3 -y
after conda activate REC-MV
, because my system gcc/g++ version was later than 10.
I added #include <stdio.h>
in cuda_inc.h
, because it caused compilation errors without that header file included.
i installed pytorch3d from this and pytorch3d is sussefully install but whats with the requirement file giving me errors
https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md
ERROR: Invalid requirement: '_libgcc_mutex=0.1=main' (from line 4 of requirements.txt) Hint: = is not a valid operator. Did you mean == ?