From 3bf4518a0cdd83903d8ad1610b5e6334520b7302 Mon Sep 17 00:00:00 2001 From: Ekaterina Aidova Date: Fri, 26 Jul 2024 14:57:35 +0400 Subject: [PATCH] triposr correct torchvision version (#2238) --- .../triposr-3d-reconstruction.ipynb | 65 +++++++++++++------ 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/notebooks/triposr-3d-reconstruction/triposr-3d-reconstruction.ipynb b/notebooks/triposr-3d-reconstruction/triposr-3d-reconstruction.ipynb index 12bdfe88110..a1548692cfd 100644 --- a/notebooks/triposr-3d-reconstruction/triposr-3d-reconstruction.ipynb +++ b/notebooks/triposr-3d-reconstruction/triposr-3d-reconstruction.ipynb @@ -53,13 +53,13 @@ }, "outputs": [], "source": [ - "%pip install -q \"gradio>=4.19\" \"torch==2.2.2\" rembg trimesh einops \"omegaconf>=2.3.0\" \"transformers>=4.35.0\" \"openvino>=2024.0.0\" --extra-index-url https://download.pytorch.org/whl/cpu\n", - "%pip install -q \"git+https://github.com/tatsy/torchmcubes.git\"" + "%pip install -q \"gradio>=4.19\" \"torch==2.2.2\" \"torchvision<0.18.0\" rembg trimesh einops \"omegaconf>=2.3.0\" \"transformers>=4.35.0\" \"openvino>=2024.0.0\" --extra-index-url https://download.pytorch.org/whl/cpu\n", + "%pip install -q \"git+https://github.com/tatsy/torchmcubes.git\" --extra-index-url https://download.pytorch.org/whl/cpu" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "b78424b7-80e4-4470-9427-7286b9837566", "metadata": {}, "outputs": [], @@ -101,7 +101,7 @@ " weight_name=\"model.ckpt\",\n", ")\n", "model.renderer.set_chunk_size(131072)\n", - "model.to(\"cpu\")" + "model.to(\"cpu\");" ] }, { @@ -123,7 +123,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "id": "d37dbcee-8c40-4cf6-a1ed-5b4c2358f4d3", "metadata": {}, "outputs": [], @@ -157,10 +157,19 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "id": "d9456c3c-64dd-4109-968c-8f51d42b9876", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/ea/miniconda3/lib/python3.11/site-packages/transformers/models/vit/modeling_vit.py:163: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!\n", + " if num_channels != self.num_channels:\n" + ] + } + ], "source": [ "VIT_PATCH_EMBEDDINGS_OV_PATH = Path(\"models/vit_patch_embeddings_ir.xml\")\n", "\n", @@ -188,7 +197,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "id": "f31d0b34-9690-454c-b497-f2330d18bac4", "metadata": {}, "outputs": [], @@ -229,7 +238,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "id": "07815ea4-f851-4c13-99b9-1b905ef998cf", "metadata": {}, "outputs": [], @@ -244,7 +253,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "465dc1db-5ce1-428f-bc90-740aa6d0dca5", "metadata": {}, "outputs": [], @@ -255,7 +264,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "id": "4b7cdbc5-ed39-49b4-922d-95603478209f", "metadata": {}, "outputs": [], @@ -271,7 +280,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "id": "b209191b-5566-48ad-adb4-0ceee5d4e469", "metadata": {}, "outputs": [], @@ -303,10 +312,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "id": "9324143f-02b5-4238-a173-4a649d9ab1d5", "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "7986388de70945238d4407af5c60c348", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Dropdown(description='Device:', index=1, options=('CPU', 'AUTO'), value='AUTO')" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "import ipywidgets as widgets\n", "\n", @@ -324,7 +349,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "379a2cb2-6086-47d9-ae83-be7f74a5c14f", "metadata": {}, "outputs": [], @@ -348,7 +373,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "id": "7f97d859-4e2d-4277-8816-7ca8d6c76778", "metadata": {}, "outputs": [], @@ -454,7 +479,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "id": "04ada5f4-6a4a-418d-8227-379b76e3faf1", "metadata": {}, "outputs": [], @@ -525,7 +550,7 @@ "\n", "\n", "def generate(image):\n", - " scene_codes = model(image, \"cpu\") # the device is provided for the image processor\n", + " scene_codes = model(image, \"cpu\") # the device is provided for the image processorit is\n", " mesh = model.extract_mesh(scene_codes)[0]\n", " mesh = to_gradio_3d_orientation(mesh)\n", " mesh_path = tempfile.NamedTemporaryFile(suffix=\".obj\", delete=False)\n", @@ -593,7 +618,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -607,7 +632,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.11.4" }, "openvino_notebooks": { "imageUrl": "https://github.com/VAST-AI-Research/TripoSR/blob/main/figures/teaser800.gif?raw=true",