aimagelab / mcmr

PyTorch code for 3DV 2021 paper: "Multi-Category Mesh Reconstruction From Image Collections"
MIT License
18 stars 2 forks source link

Installation for CUDA 11 issues #6

Closed AlbertoRemus closed 2 years ago

AlbertoRemus commented 2 years ago

Hi, I need to work with CUDA 11, so I investigated on how to do that

(PyTorch3D seemed to be really picky about the Python/PyTorch version):

Here's the sequence of commands before running this repo's scripts

conda create -n mcmr python=3.8
conda activate mcmr
conda install -c pytorch pytorch=1.10.0 torchvision cudatoolkit=11.3 -c conda-forge
conda install -c fvcore -c iopath -c conda-forge fvcore iopath
conda install -c bottler nvidiacub
conda install -c pytorch3d pytorch3d
python -m pip install opencv-python
python -m pip install imageio
python -m pip install lpips
python -m pip install tensorboard
python -m pip install meshzoo
python -m pip install scikit-image
python setup_softras.py build develop

Tested on Ubuntu20.04, with CUDA 11.4 on a docker

I place the sequence of commands I used in case others find it useful

AlbertoRemus commented 2 years ago

Just one remark about tensorboard, since on this setup https://github.com/aimagelab/mcmr/issues/6#issue-1224079249, when testing https://github.com/aimagelab/mcmr#22-cub I get:

Traceback (most recent call last):
  File "/home/robotics/object_pose_detection/mcmr/main.py", line 16, in <module>
    from torch.utils.tensorboard import SummaryWriter
  File "/home/robotics/conda/envs/mcmr/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py", line 4, in <module>
    LooseVersion = distutils.version.LooseVersion
AttributeError: module 'distutils' has no attribute 'version

since for the moment I don't need it I just commented the offending line from torch.utils.tensorboard import SummaryWriter

AlbertoRemus commented 2 years ago

Related PR https://github.com/pytorch/pytorch/pull/69904

AlbertoRemus commented 2 years ago

Just one remark about tensorboard, since on this setup https://github.com/aimagelab/mcmr/issues/6#issue-1224079249, when testing https://github.com/aimagelab/mcmr#22-cub I get:

Traceback (most recent call last): File "/home/robotics/object_pose_detection/mcmr/main.py", line 16, in from torch.utils.tensorboard import SummaryWriter File "/home/robotics/conda/envs/mcmr/lib/python3.8/site-packages/torch/utils/tensorboard/init.py", line 4, in LooseVersion = distutils.version.LooseVersion AttributeError: module 'distutils' has no attribute 'version since for the moment I don't need it I just commented the offending line from torch.utils.tensorboard import SummaryWriter

python -m pip install setuptools==59.5.0

solved for the provided configuration

stefanopini commented 2 years ago

Hi @AlbertoRemus , thanks for reporting the issue and finding solution for it! @alexj94 btw, can we remove the dependency from tensorboard and simply use torch.utils.tensorboard instead?

alexj94 commented 2 years ago

@alexj94 btw, can we remove the dependency from tensorboard and simply use torch.utils.tensorboard instead?

Unfortunately, it seems to be an issue related to the PyTorch version and it should be fixed in PyTorch 1.11 (according to the related PR https://github.com/pytorch/pytorch/pull/69904). If you use a previous version that generates the error, the only fix is the one found by @AlbertoRemus:

python -m pip install setuptools==59.5.0