From 274b6df91819bdd7728623d273a08d1fdef804bb Mon Sep 17 00:00:00 2001 From: Jeremy Reizenstein Date: Tue, 4 Apr 2023 07:48:02 -0700 Subject: [PATCH] update notebooks for 0.7.3 Summary: Allow pytorch2.0 download: ``` sed -i 's/startswith(\\"1.13.\\")/startswith\(\(\\"1.13.\\", \\"2.0.\\"\)\)/' *b ``` Remove lines which download and install CUB: ``` sed -i.bak '/1.10\.0/d' *b rm *.bak ``` Reviewed By: davidsonic Differential Revision: D44343299 fbshipit-source-id: e8399b5dd10068c717178ba9ffb0630bacca3253 --- docs/tutorials/bundle_adjustment.ipynb | 5 +---- ...position_optimization_with_differentiable_rendering.ipynb | 5 +---- docs/tutorials/dataloaders_ShapeNetCore_R2N2.ipynb | 5 +---- docs/tutorials/deform_source_mesh_to_target_mesh.ipynb | 5 +---- docs/tutorials/fit_simple_neural_radiance_field.ipynb | 5 +---- docs/tutorials/fit_textured_mesh.ipynb | 5 +---- docs/tutorials/fit_textured_volume.ipynb | 5 +---- docs/tutorials/implicitron_config_system.ipynb | 5 +---- docs/tutorials/implicitron_volumes.ipynb | 5 +---- docs/tutorials/render_colored_points.ipynb | 5 +---- docs/tutorials/render_densepose.ipynb | 5 +---- docs/tutorials/render_textured_meshes.ipynb | 5 +---- 12 files changed, 12 insertions(+), 48 deletions(-) diff --git a/docs/tutorials/bundle_adjustment.ipynb b/docs/tutorials/bundle_adjustment.ipynb index 2c7a8048..34b728b3 100644 --- a/docs/tutorials/bundle_adjustment.ipynb +++ b/docs/tutorials/bundle_adjustment.ipynb @@ -89,7 +89,7 @@ "except ModuleNotFoundError:\n", " need_pytorch3d=True\n", "if need_pytorch3d:\n", - " if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n", + " if torch.__version__.startswith((\"1.13.\", \"2.0.\")) and sys.platform.startswith(\"linux\"):\n", " # We try to install PyTorch3D via a released wheel.\n", " pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n", " version_str=\"\".join([\n", @@ -101,9 +101,6 @@ " !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html\n", " else:\n", " # We try to install PyTorch3D from source.\n", - " !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz\n", - " !tar xzf 1.10.0.tar.gz\n", - " os.environ[\"CUB_HOME\"] = os.getcwd() + \"/cub-1.10.0\"\n", " !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" ] }, diff --git a/docs/tutorials/camera_position_optimization_with_differentiable_rendering.ipynb b/docs/tutorials/camera_position_optimization_with_differentiable_rendering.ipynb index 037a3a32..6a482eb2 100644 --- a/docs/tutorials/camera_position_optimization_with_differentiable_rendering.ipynb +++ b/docs/tutorials/camera_position_optimization_with_differentiable_rendering.ipynb @@ -76,7 +76,7 @@ "except ModuleNotFoundError:\n", " need_pytorch3d=True\n", "if need_pytorch3d:\n", - " if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n", + " if torch.__version__.startswith((\"1.13.\", \"2.0.\")) and sys.platform.startswith(\"linux\"):\n", " # We try to install PyTorch3D via a released wheel.\n", " pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n", " version_str=\"\".join([\n", @@ -88,9 +88,6 @@ " !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html\n", " else:\n", " # We try to install PyTorch3D from source.\n", - " !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz\n", - " !tar xzf 1.10.0.tar.gz\n", - " os.environ[\"CUB_HOME\"] = os.getcwd() + \"/cub-1.10.0\"\n", " !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" ] }, diff --git a/docs/tutorials/dataloaders_ShapeNetCore_R2N2.ipynb b/docs/tutorials/dataloaders_ShapeNetCore_R2N2.ipynb index ac72e074..01209bed 100644 --- a/docs/tutorials/dataloaders_ShapeNetCore_R2N2.ipynb +++ b/docs/tutorials/dataloaders_ShapeNetCore_R2N2.ipynb @@ -51,7 +51,7 @@ "except ModuleNotFoundError:\n", " need_pytorch3d=True\n", "if need_pytorch3d:\n", - " if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n", + " if torch.__version__.startswith((\"1.13.\", \"2.0.\")) and sys.platform.startswith(\"linux\"):\n", " # We try to install PyTorch3D via a released wheel.\n", " pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n", " version_str=\"\".join([\n", @@ -63,9 +63,6 @@ " !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html\n", " else:\n", " # We try to install PyTorch3D from source.\n", - " !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz\n", - " !tar xzf 1.10.0.tar.gz\n", - " os.environ[\"CUB_HOME\"] = os.getcwd() + \"/cub-1.10.0\"\n", " !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" ] }, diff --git a/docs/tutorials/deform_source_mesh_to_target_mesh.ipynb b/docs/tutorials/deform_source_mesh_to_target_mesh.ipynb index da3c89ee..a669267e 100644 --- a/docs/tutorials/deform_source_mesh_to_target_mesh.ipynb +++ b/docs/tutorials/deform_source_mesh_to_target_mesh.ipynb @@ -90,7 +90,7 @@ "except ModuleNotFoundError:\n", " need_pytorch3d=True\n", "if need_pytorch3d:\n", - " if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n", + " if torch.__version__.startswith((\"1.13.\", \"2.0.\")) and sys.platform.startswith(\"linux\"):\n", " # We try to install PyTorch3D via a released wheel.\n", " pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n", " version_str=\"\".join([\n", @@ -102,9 +102,6 @@ " !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html\n", " else:\n", " # We try to install PyTorch3D from source.\n", - " !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz\n", - " !tar xzf 1.10.0.tar.gz\n", - " os.environ[\"CUB_HOME\"] = os.getcwd() + \"/cub-1.10.0\"\n", " !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" ] }, diff --git a/docs/tutorials/fit_simple_neural_radiance_field.ipynb b/docs/tutorials/fit_simple_neural_radiance_field.ipynb index 0aaaa1ef..3f5fde53 100644 --- a/docs/tutorials/fit_simple_neural_radiance_field.ipynb +++ b/docs/tutorials/fit_simple_neural_radiance_field.ipynb @@ -56,7 +56,7 @@ "except ModuleNotFoundError:\n", " need_pytorch3d=True\n", "if need_pytorch3d:\n", - " if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n", + " if torch.__version__.startswith((\"1.13.\", \"2.0.\")) and sys.platform.startswith(\"linux\"):\n", " # We try to install PyTorch3D via a released wheel.\n", " pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n", " version_str=\"\".join([\n", @@ -68,9 +68,6 @@ " !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html\n", " else:\n", " # We try to install PyTorch3D from source.\n", - " !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz\n", - " !tar xzf 1.10.0.tar.gz\n", - " os.environ[\"CUB_HOME\"] = os.getcwd() + \"/cub-1.10.0\"\n", " !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" ] }, diff --git a/docs/tutorials/fit_textured_mesh.ipynb b/docs/tutorials/fit_textured_mesh.ipynb index 2e5247f0..cc79a3dc 100644 --- a/docs/tutorials/fit_textured_mesh.ipynb +++ b/docs/tutorials/fit_textured_mesh.ipynb @@ -68,7 +68,7 @@ "except ModuleNotFoundError:\n", " need_pytorch3d=True\n", "if need_pytorch3d:\n", - " if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n", + " if torch.__version__.startswith((\"1.13.\", \"2.0.\")) and sys.platform.startswith(\"linux\"):\n", " # We try to install PyTorch3D via a released wheel.\n", " pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n", " version_str=\"\".join([\n", @@ -80,9 +80,6 @@ " !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html\n", " else:\n", " # We try to install PyTorch3D from source.\n", - " !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz\n", - " !tar xzf 1.10.0.tar.gz\n", - " os.environ[\"CUB_HOME\"] = os.getcwd() + \"/cub-1.10.0\"\n", " !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" ] }, diff --git a/docs/tutorials/fit_textured_volume.ipynb b/docs/tutorials/fit_textured_volume.ipynb index 552ca9cf..2c26555c 100644 --- a/docs/tutorials/fit_textured_volume.ipynb +++ b/docs/tutorials/fit_textured_volume.ipynb @@ -47,7 +47,7 @@ "except ModuleNotFoundError:\n", " need_pytorch3d=True\n", "if need_pytorch3d:\n", - " if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n", + " if torch.__version__.startswith((\"1.13.\", \"2.0.\")) and sys.platform.startswith(\"linux\"):\n", " # We try to install PyTorch3D via a released wheel.\n", " pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n", " version_str=\"\".join([\n", @@ -59,9 +59,6 @@ " !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html\n", " else:\n", " # We try to install PyTorch3D from source.\n", - " !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz\n", - " !tar xzf 1.10.0.tar.gz\n", - " os.environ[\"CUB_HOME\"] = os.getcwd() + \"/cub-1.10.0\"\n", " !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" ] }, diff --git a/docs/tutorials/implicitron_config_system.ipynb b/docs/tutorials/implicitron_config_system.ipynb index 572192f4..c2bc6578 100644 --- a/docs/tutorials/implicitron_config_system.ipynb +++ b/docs/tutorials/implicitron_config_system.ipynb @@ -78,7 +78,7 @@ "except ModuleNotFoundError:\n", " need_pytorch3d=True\n", "if need_pytorch3d:\n", - " if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n", + " if torch.__version__.startswith((\"1.13.\", \"2.0.\")) and sys.platform.startswith(\"linux\"):\n", " # We try to install PyTorch3D via a released wheel.\n", " pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n", " version_str=\"\".join([\n", @@ -90,9 +90,6 @@ " !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html\n", " else:\n", " # We try to install PyTorch3D from source.\n", - " !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz\n", - " !tar xzf 1.10.0.tar.gz\n", - " os.environ[\"CUB_HOME\"] = os.getcwd() + \"/cub-1.10.0\"\n", " !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" ] }, diff --git a/docs/tutorials/implicitron_volumes.ipynb b/docs/tutorials/implicitron_volumes.ipynb index c964b6d7..c614f3f7 100644 --- a/docs/tutorials/implicitron_volumes.ipynb +++ b/docs/tutorials/implicitron_volumes.ipynb @@ -72,7 +72,7 @@ "except ModuleNotFoundError:\n", " need_pytorch3d=True\n", "if need_pytorch3d:\n", - " if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n", + " if torch.__version__.startswith((\"1.13.\", \"2.0.\")) and sys.platform.startswith(\"linux\"):\n", " # We try to install PyTorch3D via a released wheel.\n", " pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n", " version_str=\"\".join([\n", @@ -84,9 +84,6 @@ " !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html\n", " else:\n", " # We try to install PyTorch3D from source.\n", - " !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz\n", - " !tar xzf 1.10.0.tar.gz\n", - " os.environ[\"CUB_HOME\"] = os.getcwd() + \"/cub-1.10.0\"\n", " !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" ] }, diff --git a/docs/tutorials/render_colored_points.ipynb b/docs/tutorials/render_colored_points.ipynb index 3b4f3ef1..7a719ae9 100644 --- a/docs/tutorials/render_colored_points.ipynb +++ b/docs/tutorials/render_colored_points.ipynb @@ -50,7 +50,7 @@ "except ModuleNotFoundError:\n", " need_pytorch3d=True\n", "if need_pytorch3d:\n", - " if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n", + " if torch.__version__.startswith((\"1.13.\", \"2.0.\")) and sys.platform.startswith(\"linux\"):\n", " # We try to install PyTorch3D via a released wheel.\n", " pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n", " version_str=\"\".join([\n", @@ -62,9 +62,6 @@ " !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html\n", " else:\n", " # We try to install PyTorch3D from source.\n", - " !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz\n", - " !tar xzf 1.10.0.tar.gz\n", - " os.environ[\"CUB_HOME\"] = os.getcwd() + \"/cub-1.10.0\"\n", " !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" ] }, diff --git a/docs/tutorials/render_densepose.ipynb b/docs/tutorials/render_densepose.ipynb index 5402c8c1..38184b5f 100644 --- a/docs/tutorials/render_densepose.ipynb +++ b/docs/tutorials/render_densepose.ipynb @@ -57,7 +57,7 @@ "except ModuleNotFoundError:\n", " need_pytorch3d=True\n", "if need_pytorch3d:\n", - " if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n", + " if torch.__version__.startswith((\"1.13.\", \"2.0.\")) and sys.platform.startswith(\"linux\"):\n", " # We try to install PyTorch3D via a released wheel.\n", " pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n", " version_str=\"\".join([\n", @@ -69,9 +69,6 @@ " !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html\n", " else:\n", " # We try to install PyTorch3D from source.\n", - " !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz\n", - " !tar xzf 1.10.0.tar.gz\n", - " os.environ[\"CUB_HOME\"] = os.getcwd() + \"/cub-1.10.0\"\n", " !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" ] }, diff --git a/docs/tutorials/render_textured_meshes.ipynb b/docs/tutorials/render_textured_meshes.ipynb index 147b7c27..7a772935 100644 --- a/docs/tutorials/render_textured_meshes.ipynb +++ b/docs/tutorials/render_textured_meshes.ipynb @@ -73,7 +73,7 @@ "except ModuleNotFoundError:\n", " need_pytorch3d=True\n", "if need_pytorch3d:\n", - " if torch.__version__.startswith(\"1.13.\") and sys.platform.startswith(\"linux\"):\n", + " if torch.__version__.startswith((\"1.13.\", \"2.0.\")) and sys.platform.startswith(\"linux\"):\n", " # We try to install PyTorch3D via a released wheel.\n", " pyt_version_str=torch.__version__.split(\"+\")[0].replace(\".\", \"\")\n", " version_str=\"\".join([\n", @@ -85,9 +85,6 @@ " !pip install --no-index --no-cache-dir pytorch3d -f https://dl.fbaipublicfiles.com/pytorch3d/packaging/wheels/{version_str}/download.html\n", " else:\n", " # We try to install PyTorch3D from source.\n", - " !curl -LO https://github.com/NVIDIA/cub/archive/1.10.0.tar.gz\n", - " !tar xzf 1.10.0.tar.gz\n", - " os.environ[\"CUB_HOME\"] = os.getcwd() + \"/cub-1.10.0\"\n", " !pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'" ] },