安装pytorch3d 遇到的问题,以及解决方案

安装pytorch3d 遇到的问题,以及解决方案

 

遇到的问题

ImportError: /usr/lib/libcudart.so.10.1: version `libcudart.so.10.1' not found (required by /home/user/anaconda3/envs/pytorch_11/lib/python3.7/site-packages/pytorch3d/_C.cpython-37m-x86_64-linux-gnu.so)

ImportError: /home/user/anaconda3/envs/pytorch_10_1/lib/python3.7/site-packages/pytorch3d/_C.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZN3c104impl23ExcludeDispatchKeyGuardC1ENS_11DispatchKeyE

 

解决方案:

一、首先参考了https://github.com/facebookresearch/detectron2/issues/157

1、uninstall conda env and your detectron2 gcc build by the following command

$ conda remove --name your_conda_name --all

detectron2$ rm -rf build

detectron2$ rm -rf **/**.so

 

2、update base conda:

conda update -n base -c defaults conda

 

3、update conda's libgcc package:

conda update libgcc

二、Pytorch3d 官网安装教程https://github.com/facebookresearch/pytorch3d/blob/master/INSTALL.md#3-install-from-a-local-clone

1、创建conda python3.8的虚拟环境

conda create -n pytorch3d python=3.8

conda activate pytorch3d

conda install -c pytorch pytorch=1.7.0 torchvision cudatoolkit=10.2

conda install -c conda-forge -c fvcore fvcore

 

2、如果使用到了cuda,需要使用下面这个命令安装所需要的库

conda install -c bottler nvidiacub

3、安装pytorch3d

conda install pytorch3d -c pytorch3d

 

你可能感兴趣的:(pytorch)