【linux】Install pytorch3d

write at the beginning

Don't read the installation blogs on the Internet, directly refer to the official installation documentation to install.

pit

Pit 1: torch.cuda cannot be used after installing pytorch3d

After installing using the following command

conda install pytorch3d

You will be prompted to install the following packages. Note that both pytorch and torchvision are cpu versions, which will overwrite our original cuda version of pytorch and torchvision, resulting in the return of torch.cuda.is_available()False.
Insert image description here

Solution 1: Install everything with conda

When you start installing torch, use conda to install it. Do not use pip to install it.
After that, when installing pytorch3d, also use conda to install it.

Solution 2: Install pytorch3d from source

It seems to be the most complicated, but it is actually the most effective.
Step 1: git clone.
Step 2: Compile and install.

git clone https://github.com/facebookresearch/pytorch3d.git
cd pytorch3d && pip install -e .

Guess you like

Origin blog.csdn.net/weixin_43693967/article/details/132155655