tutorial fixes from #336. Wheels with cuda10.1.

Summary:
Add a document to explain how to run the tutorials.
Fix API of TexturesVertex in fit_textured_mesh.
Prepare cuda 10.1 wheels (not 10.2) for linux to be available on pypi - this matches what colab has.
Change the tutorials to use these new wheels.

Reviewed By: gkioxari

Differential Revision: D23324479

fbshipit-source-id: 60e92a3f46a2d878f811b7703638f8d1dae143d9
This commit is contained in:
Jeremy Reizenstein 2020-08-25 13:09:43 -07:00 committed by Facebook GitHub Bot
parent 909dc83505
commit 32484500be
11 changed files with 63 additions and 17 deletions

View File

@ -55,7 +55,7 @@ binary_common: &binary_common
wheel_docker_image: wheel_docker_image:
description: "Wheel only: what docker image to use" description: "Wheel only: what docker image to use"
type: string type: string
default: "pytorch/manylinux-cuda102" default: "pytorch/manylinux-cuda101"
environment: environment:
PYTHON_VERSION: << parameters.python_version >> PYTHON_VERSION: << parameters.python_version >>
BUILD_VERSION: << parameters.build_version >> BUILD_VERSION: << parameters.build_version >>

View File

@ -55,7 +55,7 @@ binary_common: &binary_common
wheel_docker_image: wheel_docker_image:
description: "Wheel only: what docker image to use" description: "Wheel only: what docker image to use"
type: string type: string
default: "pytorch/manylinux-cuda102" default: "pytorch/manylinux-cuda101"
environment: environment:
PYTHON_VERSION: << parameters.python_version >> PYTHON_VERSION: << parameters.python_version >>
BUILD_VERSION: << parameters.build_version >> BUILD_VERSION: << parameters.build_version >>
@ -371,18 +371,18 @@ workflows:
python_version: '3.8' python_version: '3.8'
pytorch_version: 1.6.0 pytorch_version: 1.6.0
- binary_linux_wheel: - binary_linux_wheel:
cu_version: cu102 cu_version: cu101
name: linux_wheel_py36_cu102_pyt160 name: linux_wheel_py36_cu101_pyt160
python_version: '3.6' python_version: '3.6'
pytorch_version: 1.6.0 pytorch_version: 1.6.0
- binary_linux_wheel: - binary_linux_wheel:
cu_version: cu102 cu_version: cu101
name: linux_wheel_py37_cu102_pyt160 name: linux_wheel_py37_cu101_pyt160
python_version: '3.7' python_version: '3.7'
pytorch_version: 1.6.0 pytorch_version: 1.6.0
- binary_linux_wheel: - binary_linux_wheel:
cu_version: cu102 cu_version: cu101
name: linux_wheel_py38_cu102_pyt160 name: linux_wheel_py38_cu101_pyt160
python_version: '3.8' python_version: '3.8'
pytorch_version: 1.6.0 pytorch_version: 1.6.0
- binary_linux_conda_cuda: - binary_linux_conda_cuda:

View File

@ -39,7 +39,7 @@ def workflows(prefix="", filter_branch=None, upload=False, indentation=6):
) )
for btype in ["wheel"]: for btype in ["wheel"]:
for python_version in ["3.6", "3.7", "3.8"]: for python_version in ["3.6", "3.7", "3.8"]:
for cu_version in ["cu102"]: for cu_version in ["cu101"]:
w += workflow_pair( w += workflow_pair(
btype=btype, btype=btype,
python_version=python_version, python_version=python_version,

18
docs/tutorials/README.md Normal file
View File

@ -0,0 +1,18 @@
# Tutorial notebooks
For current versions of the tutorials, which correspond to the latest release,
please look at this directory at the `stable` tag, namely at
https://github.com/facebookresearch/pytorch3d/tree/stable/docs/tutorials .
There are links at the project homepage for opening these directly in colab.
They install torch, torchvision and PyTorch3D from pip, which should work
with the CUDA 10.1 inside a GPU colab notebook. If you need to install
pytorch3d from source inside colab, you can use
`!pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'`
instead.
The versions of these tutorials on the main branch may need to use the latest
pytorch3d from the main branch. You may be able to install this from source
with
`!pip install 'git+https://github.com/facebookresearch/pytorch3d.git'`.

View File

@ -81,7 +81,11 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"!pip install torch torchvision\n", "!pip install torch torchvision\n",
"!pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" "import sys\n",
"if torch.__version__=='1.6.0+cu101' and sys.platform.startswith('linux'):\n",
" !pip install pytorch3d\n",
"else:\n",
" !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'"
] ]
}, },
{ {

View File

@ -68,7 +68,11 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"!pip install torch torchvision\n", "!pip install torch torchvision\n",
"!pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" "import sys\n",
"if torch.__version__=='1.6.0+cu101' and sys.platform.startswith('linux'):\n",
" !pip install pytorch3d\n",
"else:\n",
" !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'"
] ]
}, },
{ {

View File

@ -43,7 +43,11 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"!pip install torch torchvision\n", "!pip install torch torchvision\n",
"!pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" "import sys\n",
"if torch.__version__=='1.6.0+cu101' and sys.platform.startswith('linux'):\n",
" !pip install pytorch3d\n",
"else:\n",
" !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'"
] ]
}, },
{ {

View File

@ -82,7 +82,11 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"!pip install torch torchvision\n", "!pip install torch torchvision\n",
"!pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" "import sys\n",
"if torch.__version__=='1.6.0+cu101' and sys.platform.startswith('linux'):\n",
" !pip install pytorch3d\n",
"else:\n",
" !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'"
] ]
}, },
{ {

View File

@ -60,7 +60,11 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"!pip install torch torchvision\n", "!pip install torch torchvision\n",
"!pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" "import sys\n",
"if torch.__version__=='1.6.0+cu101' and sys.platform.startswith('linux'):\n",
" !pip install pytorch3d\n",
"else:\n",
" !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'"
] ]
}, },
{ {
@ -781,7 +785,7 @@
" new_src_mesh = src_mesh.offset_verts(deform_verts)\n", " new_src_mesh = src_mesh.offset_verts(deform_verts)\n",
" \n", " \n",
" # Add per vertex colors to texture the mesh\n", " # Add per vertex colors to texture the mesh\n",
" new_src_mesh.textures = TexturesVertex(verts_rgb=sphere_verts_rgb) \n", " new_src_mesh.textures = TexturesVertex(verts_features=sphere_verts_rgb) \n",
" \n", " \n",
" # Losses to smooth /regularize the mesh shape\n", " # Losses to smooth /regularize the mesh shape\n",
" loss = {k: torch.tensor(0.0, device=device) for k in losses}\n", " loss = {k: torch.tensor(0.0, device=device) for k in losses}\n",

View File

@ -42,7 +42,11 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"!pip install torch torchvision\n", "!pip install torch torchvision\n",
"!pip install 'git+https://github.com/facebookresearch/pytorch3d.git'" "import sys\n",
"if torch.__version__=='1.6.0+cu101' and sys.platform.startswith('linux'):\n",
" !pip install pytorch3d\n",
"else:\n",
" !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'"
] ]
}, },
{ {

View File

@ -65,7 +65,11 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"!pip install torch torchvision\n", "!pip install torch torchvision\n",
"!pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" "import sys\n",
"if torch.__version__=='1.6.0+cu101' and sys.platform.startswith('linux'):\n",
" !pip install pytorch3d\n",
"else:\n",
" !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'"
] ]
}, },
{ {