From ceb38bfd32ff6f3bd32024381dee9e892c191b76 Mon Sep 17 00:00:00 2001
From: Yusha Arif <101613943+YushaArif99@users.noreply.github.com>
Date: Tue, 25 Jun 2024 09:26:18 +0000
Subject: [PATCH] (fix)(demos): removed the exit() command from the `demo
notebooks`
---
examples_and_demos/alexnet_demo_cpu.ipynb | 261 ++++++++++--------
...image_segmentation_with_ivy_unet_cpu.ipynb | 4 +-
examples_and_demos/resnet_demo_cpu.ipynb | 4 +-
3 files changed, 155 insertions(+), 114 deletions(-)
diff --git a/examples_and_demos/alexnet_demo_cpu.ipynb b/examples_and_demos/alexnet_demo_cpu.ipynb
index 4edd252a..8aa4659c 100644
--- a/examples_and_demos/alexnet_demo_cpu.ipynb
+++ b/examples_and_demos/alexnet_demo_cpu.ipynb
@@ -38,82 +38,85 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "\u001b[33mWARNING: Ignoring invalid distribution -ocutils (/opt/homebrew/lib/python3.10/site-packages)\u001b[0m\u001b[33m\n",
- "\u001b[0m\u001b[33mWARNING: Ignoring invalid distribution -ocutils (/opt/homebrew/lib/python3.10/site-packages)\u001b[0m\u001b[33m\n",
- "\u001b[0m\u001b[33mWARNING: Ignoring invalid distribution -ocutils (/opt/homebrew/lib/python3.10/site-packages)\u001b[0m\u001b[33m\n",
- "\u001b[0m\u001b[33mWARNING: Ignoring invalid distribution -ocutils (/opt/homebrew/lib/python3.10/site-packages)\u001b[0m\u001b[33m\n",
- "\u001b[0m\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
- "tensorflow-macos 2.15.0 requires ml-dtypes~=0.2.0, but you have ml-dtypes 0.4.0 which is incompatible.\u001b[0m\u001b[31m\n",
- "\u001b[0mCloning into 'models'...\n",
- "remote: Enumerating objects: 192, done.\u001b[K\n",
- "remote: Counting objects: 100% (192/192), done.\u001b[K\n",
- "remote: Compressing objects: 100% (156/156), done.\u001b[K\n",
- "remote: Total 192 (delta 37), reused 104 (delta 13), pack-reused 0\u001b[K\n",
- "Receiving objects: 100% (192/192), 1.83 MiB | 3.45 MiB/s, done.\n",
- "Resolving deltas: 100% (37/37), done.\n",
- "\u001b[33mWARNING: Ignoring invalid distribution -ocutils (/opt/homebrew/lib/python3.10/site-packages)\u001b[0m\u001b[33m\n",
- "\u001b[0mProcessing /Users/samuelarmstrong/Documents/ivy/demos/examples_and_demos_cpu/models\n",
+ "\n",
+ "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.0\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.1\u001b[0m\n",
+ "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpython3 -m pip install --upgrade pip\u001b[0m\n",
+ "\n",
+ "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.0\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.1\u001b[0m\n",
+ "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpython3 -m pip install --upgrade pip\u001b[0m\n",
+ "\n",
+ "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.0\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.1\u001b[0m\n",
+ "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpython3 -m pip install --upgrade pip\u001b[0m\n",
+ "fatal: destination path 'models' already exists and is not an empty directory.\n",
+ "Processing /workspaces/demos/examples_and_demos/models\n",
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
- "\u001b[?25hRequirement already satisfied: ivy in /opt/homebrew/lib/python3.10/site-packages (from ivy-models==1.1.10) (0.0.8.0)\n",
- "Requirement already satisfied: scipy in /opt/homebrew/lib/python3.10/site-packages (from ivy-models==1.1.10) (1.12.0)\n",
- "Requirement already satisfied: numpy in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (1.26.4)\n",
- "Requirement already satisfied: einops in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (0.7.0)\n",
- "Requirement already satisfied: psutil in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (5.9.8)\n",
- "Requirement already satisfied: termcolor in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (2.4.0)\n",
- "Requirement already satisfied: colorama in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (0.4.6)\n",
- "Requirement already satisfied: packaging in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (24.0)\n",
- "Requirement already satisfied: nvidia-ml-py in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (12.535.133)\n",
- "Requirement already satisfied: diskcache in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (5.6.3)\n",
- "Requirement already satisfied: google-auth in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (2.29.0)\n",
- "Requirement already satisfied: urllib3<2.0 in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (1.26.18)\n",
- "Requirement already satisfied: requests in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (2.31.0)\n",
- "Requirement already satisfied: pyvis in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (0.3.2)\n",
- "Requirement already satisfied: dill in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (0.3.8)\n",
- "Requirement already satisfied: astunparse in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (1.6.3)\n",
- "Requirement already satisfied: ml-dtypes in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (0.4.0)\n",
- "Requirement already satisfied: cloudpickle in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (3.0.0)\n",
- "Requirement already satisfied: gast in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (0.5.4)\n",
- "Requirement already satisfied: tqdm in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (4.66.2)\n",
- "Requirement already satisfied: cryptography in /opt/homebrew/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (42.0.5)\n",
- "Requirement already satisfied: wheel<1.0,>=0.23.0 in /opt/homebrew/lib/python3.10/site-packages (from astunparse->ivy->ivy-models==1.1.10) (0.43.0)\n",
- "Requirement already satisfied: six<2.0,>=1.6.1 in /opt/homebrew/lib/python3.10/site-packages (from astunparse->ivy->ivy-models==1.1.10) (1.16.0)\n",
- "Requirement already satisfied: cffi>=1.12 in /opt/homebrew/lib/python3.10/site-packages (from cryptography->ivy->ivy-models==1.1.10) (1.16.0)\n",
- "Requirement already satisfied: cachetools<6.0,>=2.0.0 in /opt/homebrew/lib/python3.10/site-packages (from google-auth->ivy->ivy-models==1.1.10) (5.3.3)\n",
- "Requirement already satisfied: pyasn1-modules>=0.2.1 in /opt/homebrew/lib/python3.10/site-packages (from google-auth->ivy->ivy-models==1.1.10) (0.3.0)\n",
- "Requirement already satisfied: rsa<5,>=3.1.4 in /opt/homebrew/lib/python3.10/site-packages (from google-auth->ivy->ivy-models==1.1.10) (4.9)\n",
- "Requirement already satisfied: ipython>=5.3.0 in /opt/homebrew/lib/python3.10/site-packages (from pyvis->ivy->ivy-models==1.1.10) (8.22.2)\n",
- "Requirement already satisfied: jinja2>=2.9.6 in /opt/homebrew/lib/python3.10/site-packages (from pyvis->ivy->ivy-models==1.1.10) (3.1.3)\n",
- "Requirement already satisfied: jsonpickle>=1.4.1 in /opt/homebrew/lib/python3.10/site-packages (from pyvis->ivy->ivy-models==1.1.10) (3.0.3)\n",
- "Requirement already satisfied: networkx>=1.11 in /opt/homebrew/lib/python3.10/site-packages (from pyvis->ivy->ivy-models==1.1.10) (3.2.1)\n",
- "Requirement already satisfied: charset-normalizer<4,>=2 in /opt/homebrew/lib/python3.10/site-packages (from requests->ivy->ivy-models==1.1.10) (3.3.2)\n",
- "Requirement already satisfied: idna<4,>=2.5 in /opt/homebrew/lib/python3.10/site-packages (from requests->ivy->ivy-models==1.1.10) (3.6)\n",
- "Requirement already satisfied: certifi>=2017.4.17 in /opt/homebrew/lib/python3.10/site-packages (from requests->ivy->ivy-models==1.1.10) (2024.2.2)\n",
- "Requirement already satisfied: pycparser in /opt/homebrew/lib/python3.10/site-packages (from cffi>=1.12->cryptography->ivy->ivy-models==1.1.10) (2.21)\n",
- "Requirement already satisfied: decorator in /opt/homebrew/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (5.1.1)\n",
- "Requirement already satisfied: jedi>=0.16 in /opt/homebrew/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.19.1)\n",
- "Requirement already satisfied: matplotlib-inline in /opt/homebrew/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.1.6)\n",
- "Requirement already satisfied: prompt-toolkit<3.1.0,>=3.0.41 in /opt/homebrew/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (3.0.43)\n",
- "Requirement already satisfied: pygments>=2.4.0 in /opt/homebrew/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (2.17.2)\n",
- "Requirement already satisfied: stack-data in /opt/homebrew/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.6.3)\n",
- "Requirement already satisfied: traitlets>=5.13.0 in /opt/homebrew/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (5.14.2)\n",
- "Requirement already satisfied: exceptiongroup in /opt/homebrew/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (1.2.0)\n",
- "Requirement already satisfied: pexpect>4.3 in /opt/homebrew/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (4.9.0)\n",
- "Requirement already satisfied: MarkupSafe>=2.0 in /opt/homebrew/lib/python3.10/site-packages (from jinja2>=2.9.6->pyvis->ivy->ivy-models==1.1.10) (2.1.5)\n",
- "Requirement already satisfied: pyasn1<0.6.0,>=0.4.6 in /opt/homebrew/lib/python3.10/site-packages (from pyasn1-modules>=0.2.1->google-auth->ivy->ivy-models==1.1.10) (0.5.1)\n",
- "Requirement already satisfied: parso<0.9.0,>=0.8.3 in /opt/homebrew/lib/python3.10/site-packages (from jedi>=0.16->ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.8.3)\n",
- "Requirement already satisfied: ptyprocess>=0.5 in /opt/homebrew/lib/python3.10/site-packages (from pexpect>4.3->ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.7.0)\n",
- "Requirement already satisfied: wcwidth in /opt/homebrew/lib/python3.10/site-packages (from prompt-toolkit<3.1.0,>=3.0.41->ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.2.13)\n",
- "Requirement already satisfied: executing>=1.2.0 in /opt/homebrew/lib/python3.10/site-packages (from stack-data->ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (2.0.1)\n",
- "Requirement already satisfied: asttokens>=2.1.0 in /opt/homebrew/lib/python3.10/site-packages (from stack-data->ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (2.4.1)\n",
- "Requirement already satisfied: pure-eval in /opt/homebrew/lib/python3.10/site-packages (from stack-data->ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.2.2)\n",
+ "\u001b[?25hRequirement already satisfied: ivy in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy-models==1.1.10) (0.0.9.2)\n",
+ "Requirement already satisfied: scipy in /home/codespace/.local/lib/python3.10/site-packages (from ivy-models==1.1.10) (1.13.1)\n",
+ "Requirement already satisfied: numpy in /home/codespace/.local/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (1.26.4)\n",
+ "Requirement already satisfied: einops in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (0.8.0)\n",
+ "Requirement already satisfied: psutil in /home/codespace/.local/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (5.9.8)\n",
+ "Requirement already satisfied: termcolor in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (2.4.0)\n",
+ "Requirement already satisfied: colorama in /home/codespace/.local/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (0.4.6)\n",
+ "Requirement already satisfied: packaging in /home/codespace/.local/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (24.0)\n",
+ "Requirement already satisfied: nvidia-ml-py in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (12.555.43)\n",
+ "Requirement already satisfied: diskcache in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (5.6.3)\n",
+ "Requirement already satisfied: google-auth in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (2.30.0)\n",
+ "Requirement already satisfied: urllib3<2.0 in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (1.26.19)\n",
+ "Requirement already satisfied: requests in /home/codespace/.local/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (2.32.3)\n",
+ "Requirement already satisfied: pyvis in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (0.3.2)\n",
+ "Requirement already satisfied: dill in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (0.3.8)\n",
+ "Requirement already satisfied: astunparse in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (1.6.3)\n",
+ "Requirement already satisfied: ml-dtypes in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (0.4.0)\n",
+ "Requirement already satisfied: cloudpickle in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (3.0.0)\n",
+ "Requirement already satisfied: gast in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (0.5.4)\n",
+ "Requirement already satisfied: tqdm in /usr/local/python/3.10.13/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (4.66.4)\n",
+ "Requirement already satisfied: cryptography in /home/codespace/.local/lib/python3.10/site-packages (from ivy->ivy-models==1.1.10) (42.0.8)\n",
+ "Requirement already satisfied: wheel<1.0,>=0.23.0 in /usr/local/python/3.10.13/lib/python3.10/site-packages (from astunparse->ivy->ivy-models==1.1.10) (0.43.0)\n",
+ "Requirement already satisfied: six<2.0,>=1.6.1 in /home/codespace/.local/lib/python3.10/site-packages (from astunparse->ivy->ivy-models==1.1.10) (1.16.0)\n",
+ "Requirement already satisfied: cffi>=1.12 in /home/codespace/.local/lib/python3.10/site-packages (from cryptography->ivy->ivy-models==1.1.10) (1.16.0)\n",
+ "Requirement already satisfied: cachetools<6.0,>=2.0.0 in /usr/local/python/3.10.13/lib/python3.10/site-packages (from google-auth->ivy->ivy-models==1.1.10) (5.3.3)\n",
+ "Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/python/3.10.13/lib/python3.10/site-packages (from google-auth->ivy->ivy-models==1.1.10) (0.4.0)\n",
+ "Requirement already satisfied: rsa<5,>=3.1.4 in /usr/local/python/3.10.13/lib/python3.10/site-packages (from google-auth->ivy->ivy-models==1.1.10) (4.9)\n",
+ "Requirement already satisfied: ipython>=5.3.0 in /home/codespace/.local/lib/python3.10/site-packages (from pyvis->ivy->ivy-models==1.1.10) (8.24.0)\n",
+ "Requirement already satisfied: jinja2>=2.9.6 in /home/codespace/.local/lib/python3.10/site-packages (from pyvis->ivy->ivy-models==1.1.10) (3.1.4)\n",
+ "Requirement already satisfied: jsonpickle>=1.4.1 in /usr/local/python/3.10.13/lib/python3.10/site-packages (from pyvis->ivy->ivy-models==1.1.10) (3.2.2)\n",
+ "Requirement already satisfied: networkx>=1.11 in /home/codespace/.local/lib/python3.10/site-packages (from pyvis->ivy->ivy-models==1.1.10) (3.3)\n",
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /home/codespace/.local/lib/python3.10/site-packages (from requests->ivy->ivy-models==1.1.10) (3.3.2)\n",
+ "Requirement already satisfied: idna<4,>=2.5 in /home/codespace/.local/lib/python3.10/site-packages (from requests->ivy->ivy-models==1.1.10) (3.7)\n",
+ "Requirement already satisfied: certifi>=2017.4.17 in /home/codespace/.local/lib/python3.10/site-packages (from requests->ivy->ivy-models==1.1.10) (2024.2.2)\n",
+ "Requirement already satisfied: pycparser in /home/codespace/.local/lib/python3.10/site-packages (from cffi>=1.12->cryptography->ivy->ivy-models==1.1.10) (2.22)\n",
+ "Requirement already satisfied: decorator in /home/codespace/.local/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (5.1.1)\n",
+ "Requirement already satisfied: jedi>=0.16 in /home/codespace/.local/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.19.1)\n",
+ "Requirement already satisfied: matplotlib-inline in /home/codespace/.local/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.1.7)\n",
+ "Requirement already satisfied: prompt-toolkit<3.1.0,>=3.0.41 in /home/codespace/.local/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (3.0.45)\n",
+ "Requirement already satisfied: pygments>=2.4.0 in /home/codespace/.local/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (2.18.0)\n",
+ "Requirement already satisfied: stack-data in /home/codespace/.local/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.6.3)\n",
+ "Requirement already satisfied: traitlets>=5.13.0 in /home/codespace/.local/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (5.14.3)\n",
+ "Requirement already satisfied: exceptiongroup in /home/codespace/.local/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (1.2.1)\n",
+ "Requirement already satisfied: typing-extensions>=4.6 in /home/codespace/.local/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (4.12.0)\n",
+ "Requirement already satisfied: pexpect>4.3 in /home/codespace/.local/lib/python3.10/site-packages (from ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (4.9.0)\n",
+ "Requirement already satisfied: MarkupSafe>=2.0 in /home/codespace/.local/lib/python3.10/site-packages (from jinja2>=2.9.6->pyvis->ivy->ivy-models==1.1.10) (2.1.5)\n",
+ "Requirement already satisfied: pyasn1<0.7.0,>=0.4.6 in /usr/local/python/3.10.13/lib/python3.10/site-packages (from pyasn1-modules>=0.2.1->google-auth->ivy->ivy-models==1.1.10) (0.6.0)\n",
+ "Requirement already satisfied: parso<0.9.0,>=0.8.3 in /home/codespace/.local/lib/python3.10/site-packages (from jedi>=0.16->ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.8.4)\n",
+ "Requirement already satisfied: ptyprocess>=0.5 in /home/codespace/.local/lib/python3.10/site-packages (from pexpect>4.3->ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.7.0)\n",
+ "Requirement already satisfied: wcwidth in /home/codespace/.local/lib/python3.10/site-packages (from prompt-toolkit<3.1.0,>=3.0.41->ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.2.13)\n",
+ "Requirement already satisfied: executing>=1.2.0 in /home/codespace/.local/lib/python3.10/site-packages (from stack-data->ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (2.0.1)\n",
+ "Requirement already satisfied: asttokens>=2.1.0 in /home/codespace/.local/lib/python3.10/site-packages (from stack-data->ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (2.4.1)\n",
+ "Requirement already satisfied: pure-eval in /home/codespace/.local/lib/python3.10/site-packages (from stack-data->ipython>=5.3.0->pyvis->ivy->ivy-models==1.1.10) (0.2.2)\n",
"Building wheels for collected packages: ivy-models\n",
" Building wheel for ivy-models (setup.py) ... \u001b[?25ldone\n",
- "\u001b[?25h Created wheel for ivy-models: filename=ivy_models-1.1.10-py3-none-any.whl size=76449 sha256=4ef86060439480c8cdd692e30d269e68540c3728a30c4a372981b0c5c0cbc214\n",
- " Stored in directory: /private/var/folders/3x/7zt1qbl12mn7zq12fzzv6xh80000gn/T/pip-ephem-wheel-cache-abb7vdwj/wheels/01/2d/88/adc983ab61e1210a8d2ee2a20d1fc3d7c3e082fcdeabe25595\n",
+ "\u001b[?25h Created wheel for ivy-models: filename=ivy_models-1.1.10-py3-none-any.whl size=76446 sha256=a65e1193f2e469b5b81fdf39509425aa0da649b1b6a8bce1ec3f2847e3302c6a\n",
+ " Stored in directory: /tmp/pip-ephem-wheel-cache-n8e295vx/wheels/56/63/c6/64212e1295b5d6b58c79e12d2eee5e2dafafa8bc0e0134d16c\n",
"Successfully built ivy-models\n",
- "\u001b[33mWARNING: Ignoring invalid distribution -ocutils (/opt/homebrew/lib/python3.10/site-packages)\u001b[0m\u001b[33m\n",
- "\u001b[0mInstalling collected packages: ivy-models\n",
- "Successfully installed ivy-models-1.1.10\n"
+ "Installing collected packages: ivy-models\n",
+ " Attempting uninstall: ivy-models\n",
+ " Found existing installation: ivy-models 1.1.10\n",
+ " Uninstalling ivy-models-1.1.10:\n",
+ " Successfully uninstalled ivy-models-1.1.10\n",
+ "Successfully installed ivy-models-1.1.10\n",
+ "\n",
+ "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.0\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.1\u001b[0m\n",
+ "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpython3 -m pip install --upgrade pip\u001b[0m\n"
]
}
],
@@ -123,9 +126,7 @@
"!git clone https://github.com/unifyai/models.git --depth 1\n",
"\n",
"# Installing models package from cloned repository! π\n",
- "!cd models/ && pip install .\n",
- "\n",
- "exit()"
+ "!cd models/ && pip install ."
]
},
{
@@ -157,30 +158,17 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "zsh:1: command not found: wget\n"
- ]
- },
- {
- "ename": "FileNotFoundError",
- "evalue": "[Errno 2] No such file or directory: 'imagenet_classes.txt'",
- "output_type": "error",
- "traceback": [
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
- "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
- "Cell \u001b[0;32mIn[2], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m get_ipython()\u001b[38;5;241m.\u001b[39msystem(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mwget https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28;43mopen\u001b[39;49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mimagenet_classes.txt\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mr\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m f:\n\u001b[1;32m 3\u001b[0m categories \u001b[38;5;241m=\u001b[39m [s\u001b[38;5;241m.\u001b[39mstrip() \u001b[38;5;28;01mfor\u001b[39;00m s \u001b[38;5;129;01min\u001b[39;00m f\u001b[38;5;241m.\u001b[39mreadlines()]\n",
- "File \u001b[0;32m/opt/homebrew/lib/python3.10/site-packages/IPython/core/interactiveshell.py:324\u001b[0m, in \u001b[0;36m_modified_open\u001b[0;34m(file, *args, **kwargs)\u001b[0m\n\u001b[1;32m 317\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m file \u001b[38;5;129;01min\u001b[39;00m {\u001b[38;5;241m0\u001b[39m, \u001b[38;5;241m1\u001b[39m, \u001b[38;5;241m2\u001b[39m}:\n\u001b[1;32m 318\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\n\u001b[1;32m 319\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mIPython won\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt let you open fd=\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mfile\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m by default \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 320\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mas it is likely to crash IPython. If you know what you are doing, \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 321\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124myou can use builtins\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m open.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 322\u001b[0m )\n\u001b[0;32m--> 324\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mio_open\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfile\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
- "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'imagenet_classes.txt'"
- ]
- },
- {
- "ename": "",
- "evalue": "",
- "output_type": "error",
- "traceback": [
- "\u001b[1;31mThe Kernel crashed while executing code in the current cell or a previous cell. \n",
- "\u001b[1;31mPlease review the code in the cell(s) to identify a possible cause of the failure. \n",
- "\u001b[1;31mClick here for more info. \n",
- "\u001b[1;31mView Jupyter log for further details."
+ "--2024-06-25 06:49:43-- https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt\n",
+ "Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.109.133, ...\n",
+ "Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.\n",
+ "HTTP request sent, awaiting response... 200 OK\n",
+ "Length: 10472 (10K) [text/plain]\n",
+ "Saving to: βimagenet_classes.txt.2β\n",
+ "\n",
+ "imagenet_classes.tx 100%[===================>] 10.23K --.-KB/s in 0.002s \n",
+ "\n",
+ "2024-06-25 06:49:43 (6.50 MB/s) - βimagenet_classes.txt.2β saved [10472/10472]\n",
+ "\n"
]
}
],
@@ -192,19 +180,37 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 3,
"metadata": {
"id": "h2GAB_m5puD5"
},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "--2024-06-25 06:49:47-- https://raw.githubusercontent.com/unifyai/models/master/images/cat.jpg\n",
+ "Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.111.133, 185.199.109.133, ...\n",
+ "Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.\n",
+ "HTTP request sent, awaiting response... 200 OK\n",
+ "Length: 634575 (620K) [image/jpeg]\n",
+ "Saving to: βcat.jpg.2β\n",
+ "\n",
+ "cat.jpg.2 100%[===================>] 619.70K 2.83MB/s in 0.2s \n",
+ "\n",
+ "2024-06-25 06:49:47 (2.83 MB/s) - βcat.jpg.2β saved [634575/634575]\n",
+ "\n"
+ ]
+ }
+ ],
"source": [
"!wget https://raw.githubusercontent.com/unifyai/models/master/images/cat.jpg\n",
- "filename = \"cat.jpg\""
+ "filename = \"cat.jpg\"\n"
]
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 4,
"metadata": {
"id": "h9wqmWi3pusC"
},
@@ -238,7 +244,7 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 5,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
@@ -284,11 +290,34 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 8,
"metadata": {
"id": "jxCOosEqsxx4"
},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cleaning up existing binaries --> done\n",
+ "Downloading new binaries...\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "100%|ββββββββββ| 132/132 [02:05<00:00, 1.05it/s]\n"
+ ]
+ },
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Downloaded all binaries!\n"
+ ]
+ }
+ ],
"source": [
"import ivy\n",
"ivy.set_soft_device_mode(True)\n",
@@ -309,11 +338,27 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 14,
"metadata": {
"id": "cGAW-CxisO2Q"
},
- "outputs": [],
+ "outputs": [
+ {
+ "ename": "ModuleNotFoundError",
+ "evalue": "No module named 'astor'",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
+ "\u001b[1;32m/workspaces/demos/examples_and_demos/alexnet_demo_cpu.ipynb Cell 14\u001b[0m line \u001b[0;36m1\n\u001b[0;32m----> 1\u001b[0m ivy_alexnet \u001b[39m=\u001b[39m ivy\u001b[39m.\u001b[39;49mtrace_graph(ivy_alexnet, args\u001b[39m=\u001b[39;49m(ivy\u001b[39m.\u001b[39;49masarray(torch_img),))\n",
+ "File \u001b[0;32m/workspaces/demos/ivy/ivy/compiler/compiler.py:129\u001b[0m, in \u001b[0;36mtrace_graph\u001b[0;34m(stateful, arg_stateful_idxs, kwarg_stateful_idxs, to, include_generators, array_caching, with_numpy, modes_to_trace, backend_compile, static_argnums, static_argnames, compile_mode, graph_caching, args, kwargs, params_v, v, *objs)\u001b[0m\n\u001b[1;32m 37\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mtrace_graph\u001b[39m(\n\u001b[1;32m 38\u001b[0m \u001b[39m*\u001b[39mobjs: Callable,\n\u001b[1;32m 39\u001b[0m stateful: Optional[List] \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 55\u001b[0m v\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m\n\u001b[1;32m 56\u001b[0m ):\n\u001b[1;32m 57\u001b[0m \u001b[39m \u001b[39m\u001b[39m\"\"\"Takes `fn` and traces it into a more efficient composition of backend operations.\u001b[39;00m\n\u001b[1;32m 58\u001b[0m \n\u001b[1;32m 59\u001b[0m \u001b[39m Parameters\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 126\u001b[0m \u001b[39m >>> print(time.time() - start)\u001b[39;00m\n\u001b[1;32m 127\u001b[0m \u001b[39m 0.0001785755157470703\"\"\"\u001b[39;00m\n\u001b[0;32m--> 129\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39m.\u001b[39;00m\u001b[39m_compiler\u001b[39;00m \u001b[39mimport\u001b[39;00m trace_graph \u001b[39mas\u001b[39;00m _trace_graph\n\u001b[1;32m 131\u001b[0m \u001b[39mreturn\u001b[39;00m _trace_graph(\n\u001b[1;32m 132\u001b[0m \u001b[39m*\u001b[39mobjs,\n\u001b[1;32m 133\u001b[0m stateful\u001b[39m=\u001b[39mstateful,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 149\u001b[0m v\u001b[39m=\u001b[39mv,\n\u001b[1;32m 150\u001b[0m )\n",
+ "File \u001b[0;32m_compiler.pyx:142\u001b[0m, in \u001b[0;36minit combined_source._compiler\u001b[0;34m()\u001b[0m\n",
+ "File \u001b[0;32m_compiler.pyx:76\u001b[0m, in \u001b[0;36mcombined_source._compiler\u001b[0;34m()\u001b[0m\n",
+ "File \u001b[0;32mIXV.pyx:9\u001b[0m, in \u001b[0;36minit IXV\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'astor'"
+ ]
+ }
+ ],
"source": [
"ivy_alexnet = ivy.trace_graph(ivy_alexnet, args=(ivy.asarray(torch_img),))"
]
diff --git a/examples_and_demos/image_segmentation_with_ivy_unet_cpu.ipynb b/examples_and_demos/image_segmentation_with_ivy_unet_cpu.ipynb
index 82420453..fbf5ed4d 100644
--- a/examples_and_demos/image_segmentation_with_ivy_unet_cpu.ipynb
+++ b/examples_and_demos/image_segmentation_with_ivy_unet_cpu.ipynb
@@ -37,9 +37,7 @@
"!git clone https://github.com/unifyai/models.git --depth 1\n",
"\n",
"# Installing models package from cloned repository! π\n",
- "!cd models/ && pip install .\n",
- "\n",
- "exit()"
+ "!cd models/ && pip install .\n"
]
},
{
diff --git a/examples_and_demos/resnet_demo_cpu.ipynb b/examples_and_demos/resnet_demo_cpu.ipynb
index 7f344f7d..e0a2cfa8 100644
--- a/examples_and_demos/resnet_demo_cpu.ipynb
+++ b/examples_and_demos/resnet_demo_cpu.ipynb
@@ -47,9 +47,7 @@
"# Installing models package from cloned repository! π\n",
"!cd models/ && pip install .\n",
"\n",
- "!python3 -m pip install torchvision\n",
- "\n",
- "exit()"
+ "!python3 -m pip install torchvision\n"
]
},
{