一、准备工作
官网给出了很多准备要求,在我的实际操作中(两种安装方式 installing prebuilt binaries / building from source),主要受到了以下限制:
-
gcc版本不宜过高,否则很可能在自己build Pytorch3D时出现各种各样的问题(我在使用9.x版本build时失败),个人推荐7.5(Pytorch3D官方要求gcc & g++ ≥ 4.9,对于Ubuntu 16.04默认gcc可能过低或现有gcc过高的情况,下载合适的gcc版本切换优先级即可)
-
CUDA版本尽量选择高版本,9.x有可能找不到合适的prebuilt 版本,个人推荐10.2
-
在整个安装过程中版本之间限制比较繁杂,并且考虑到网络问题,个人成功配置(均在Ubuntu 16.04环境下)是
Installing prebuilt binaries: python=3.8 + pytorch=1.7.1 + cuda=10.2 + gcc=7.5 + pytorch3d=0.6.1 (conda 安装)
Building from source: python=3.8 + pytorch=1.6.0 + cuda=10.2 + gcc=7.5 + pytorch3d=0.6.1 (git clone 下载)
二、极简安装(Installing prebuilt binaries)
如果一切顺利(但愿),这就是最便捷的安装方法。
1.创建环境
命令如下:
conda create -n pytorch3d python=3.8
conda activate pytorch3d
2.安装Pytorch
命令如下:
conda install -c pytorch pytorch=1.7.1 torchvision cudatoolkit=10.2
顺便把Pytorch安装版本库贴在这里:
Previous PyTorch Versions | PyTorch
3.安装两个核心库
命令如下:
conda install -c fvcore -c iopath -c conda-forge fvcore iopath
如果安装出现问题可以看第三节手动安装。
4.(非必要)Tests/Linting and Demos 相关
Demos and examples
conda install jupyter
pip install scikit-image matplotlib imageio plotly opencv-python
Tests/Linting
pip install black 'isort<5' flake8 flake8-bugbear flake8-comprehensions
5.安装Pytorch3D
Anaconda Cloud
conda install pytorch3d -c pytorc
浙公网安备 33010602011771号