当前位置:   article > 正文

Pytorch-3D(安装)环境搭建小记_pytorch3d 安装

pytorch3d 安装

Pytorch-3D(安装)环境搭建小记

如下是Pytorch-3D官网给出的why pytorch?

Our goal with PyTorch3D is to help accelerate research at the intersection of deep learning and 3D. 3D data is more complex than 2D images and while working on projects such as Mesh R-CNN and C3DPO, we encountered several challenges including 3D data representation, batching, and speed. We have developed many useful operators and abstractions for working on 3D deep learning and want to share this with the community to drive novel research in this area.

In PyTorch3D we have included efficient 3D operators, heterogeneous batching capabilities, and a modular differentiable rendering API, to equip researchers in this field with a much needed toolkit to implement cutting-edge research with complex 3D inputs.

自己在尝试跑demo的时候,仅是在Pytorch-3D的环境搭建中就出现了很多问题,浪费了不少时间。反思一下,因为一些小的问题,不能静心解决问题,而是自乱阵脚,越改越乱,绕了很多路。(完成一件事情可能没有捷径,但一定有弯路。)记录一下一个可以成功安装的方式,与官方给出的install.md基本一致,只是记录这种尝试是可以安装成功的。(针对linux)
安装过程
# 创建虚拟环境,以避免把自己已有的环境或者主环境弄坏,选用的python版本为3.8
conda create -n pytorch3d python=3.8

# 激活已经创建的虚拟环境
conda activate pytorch3d

# 安装pytorch,这里就出现了一些问题。
# 第一次尝试的时候,安装cudatoolkit=10.2,但是后来安装pytorch-3d时总是找不到对应的包。
# 于是就直接安装了cudatoolkit=10.1,后面的执行是成功的。
conda install -c pytorch pytorch torchvision cudatoolkit=10.1

# 安装fvcore
conda install -c conda-forge -c fvcore fvcore

# 下面这些也就稀里糊涂都安装了
conda install jupyter
pip install scikit-image matplotlib imageio
pip install black isort flake8 flake8-bugbear flake8-comprehensions

# 到了最后的关键步骤,就是安装pyrorch-3d
# 当cudatoolkit=10.2时,使用下面第一条命令,就会出现找不到包。
# 后来也没有多尝试,就直接改用cudatoolkit=10.1了,但是cudatoolkit=10.1使用第一条命令还是会报UnsatisfiableError。
# 当cudatoolkit=10.1时,使用第二条命令,安装成功。
# 后来看到博客说,当cudatoolkit=10.2时,使用下面第二条命令,也能成功。

conda install pytorch3d -c pytorch3d        # 1)

# install a nightly (non-official, alpha) build
conda install pytorch3d -c pytorch3d-nightly      # 2)

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
说下来感觉最关键的点竟然在于使用
conda install pytorch3d -c pytorch3d-nightly  
  • 1
细心、冷静一点真的很重要。
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/308440
推荐阅读
相关标签
  

闽ICP备14008679号