Skip to content

Commit

Permalink
remove upperbound for matplotlib on win where it is possible (#2454)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova authored Oct 17, 2024
1 parent e594dd3 commit 095090d
Show file tree
Hide file tree
Showing 38 changed files with 104 additions and 220 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,7 @@
"metadata": {},
"outputs": [],
"source": [
"import platform\n",
"\n",
"%pip install -q \"openvino>=2023.1.0\" \"tqdm\"\n",
"\n",
"if platform.system() != \"Windows\":\n",
" %pip install -q \"matplotlib>=3.4\"\n",
"else:\n",
" %pip install -q \"matplotlib>=3.4,<3.7\""
"%pip install -q \"openvino>=2023.1.0\" \"tqdm\" \"matplotlib>=3.4\""
]
},
{
Expand Down
8 changes: 1 addition & 7 deletions notebooks/async-api/async-api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,8 @@
"metadata": {},
"outputs": [],
"source": [
"import platform\n",
"\n",
"%pip install -q \"openvino>=2023.1.0\"\n",
"%pip install -q opencv-python\n",
"if platform.system() != \"windows\":\n",
" %pip install -q \"matplotlib>=3.4\"\n",
"else:\n",
" %pip install -q \"matplotlib>=3.4,<3.7\""
"%pip install -q opencv-python \"matplotlib>=3.4\""
]
},
{
Expand Down
8 changes: 3 additions & 5 deletions notebooks/auto-device/auto-device.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,10 @@
"import platform\n",
"\n",
"# Install required packages\n",
"%pip install -q \"openvino>=2023.1.0\" \"numpy<2\" Pillow torch torchvision tqdm --extra-index-url https://download.pytorch.org/whl/cpu\n",
"%pip install -q \"openvino>=2023.1.0\" \"matplotlib>=3.4\" Pillow torch torchvision tqdm --extra-index-url https://download.pytorch.org/whl/cpu\n",
"\n",
"if platform.system() != \"Windows\":\n",
" %pip install -q \"matplotlib>=3.4\"\n",
"else:\n",
" %pip install -q \"matplotlib>=3.4,<3.7\""
"if platform.system() == \"Darwin\":\n",
" %pip install -q \"numpy<2.0.0\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,7 @@
"metadata": {},
"outputs": [],
"source": [
"import platform\n",
"\n",
"%pip install -q --extra-index-url https://download.pytorch.org/whl/cpu \"gradio>=4.19\" \"openvino>=2023.1.0\" \"transformers[torch]>=4.30\" \"datasets\" \"nncf>=2.6.0\" \"torch>=2.1\" Pillow\n",
"\n",
"if platform.system() != \"Windows\":\n",
" %pip install -q \"matplotlib>=3.4\"\n",
"else:\n",
" %pip install -q \"matplotlib>=3.4,<3.7\"\n",
"%pip install -q --extra-index-url https://download.pytorch.org/whl/cpu \"gradio>=4.19\" \"matplotlib>=3.4\" \"openvino>=2023.1.0\" \"transformers[torch]>=4.30\" \"datasets\" \"nncf>=2.6.0\" \"torch>=2.1\" Pillow\n",
"\n",
"import requests\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"outputs": [],
"source": [
"%pip install -q --extra-index-url https://download.pytorch.org/whl/cpu \"torch>=2.1\" \"torchvision\"\n",
"%pip install -q \"diffusers>=0.14.0\" \"transformers>=4.30.2\" \"controlnet-aux>=0.0.6\" \"gradio>=3.36\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
"%pip install -q \"diffusers>=0.14.0\" \"matplotlib>=3.4\" \"transformers>=4.30.2\" \"controlnet-aux>=0.0.6\" \"gradio>=3.36\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
"%pip install -q \"openvino>=2023.1.0\" \"datasets>=2.14.6\" \"nncf>=2.7.0\"\n",
"\n",
"import requests\n",
Expand Down
51 changes: 22 additions & 29 deletions notebooks/convert-to-openvino/convert-to-openvino.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@
"outputs": [],
"source": [
"# Required imports. Please execute this cell first.\n",
"%pip install --upgrade pip\n",
"%pip install -q --extra-index-url https://download.pytorch.org/whl/cpu \\\n",
"\"openvino-dev>=2024.0.0\" \"requests\" \"tqdm\" \"transformers>=4.31\" \"onnx<1.16.2\" \"torch>=2.1\" \"torchvision\" \"tensorflow_hub\" \"tensorflow\""
"\"openvino>=2024.4.0\" \"requests\" \"tqdm\" \"transformers>=4.31\" \"onnx!=1.16.2\" \"torch>=2.1\" \"torchvision\" \"tensorflow_hub\" \"tensorflow\""
]
},
{
Expand Down Expand Up @@ -617,26 +616,16 @@
]
},
{
"cell_type": "code",
"execution_count": 20,
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\n",
"To disable this warning, you can either:\n",
"\t- Avoid using `tokenizers` before the fork if possible\n",
"\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n"
]
}
],
"source": [
"```python\n",
"# Legacy Model Optimizer API\n",
"from openvino.tools import mo\n",
"\n",
"ov_model = mo.convert_model(ONNX_CV_MODEL_PATH, layout=\"nchw\")"
"ov_model = mo.convert_model(ONNX_CV_MODEL_PATH, layout=\"nchw\")\n",
"```"
]
},
{
Expand Down Expand Up @@ -670,18 +659,19 @@
]
},
{
"cell_type": "code",
"execution_count": 22,
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": [
"# Legacy Model Optimizer API\n",
"```python\n",
"from openvino.tools import mo\n",
"\n",
"ov_model = mo.convert_model(ONNX_CV_MODEL_PATH, layout=\"nchw->nhwc\")\n",
"\n",
"# alternatively use source_layout and target_layout parameters\n",
"ov_model = mo.convert_model(ONNX_CV_MODEL_PATH, source_layout=\"nchw\", target_layout=\"nhwc\")"
"ov_model = mo.convert_model(ONNX_CV_MODEL_PATH, source_layout=\"nchw\", target_layout=\"nhwc\")\n",
"```"
]
},
{
Expand Down Expand Up @@ -715,20 +705,22 @@
]
},
{
"cell_type": "code",
"execution_count": 24,
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": [
"```python\n",
"# Legacy Model Optimizer API\n",
"\n",
"from openvino.tools import mo\n",
"\n",
"\n",
"ov_model = mo.convert_model(\n",
" ONNX_CV_MODEL_PATH,\n",
" mean_values=[255 * x for x in [0.485, 0.456, 0.406]],\n",
" scale_values=[255 * x for x in [0.229, 0.224, 0.225]],\n",
")"
")\n",
"```"
]
},
{
Expand Down Expand Up @@ -760,15 +752,16 @@
]
},
{
"cell_type": "code",
"execution_count": 26,
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": [
"```python\n",
"# Legacy Model Optimizer API\n",
"from openvino.tools import mo\n",
"\n",
"ov_model = mo.convert_model(ONNX_CV_MODEL_PATH, reverse_input_channels=True)"
"ov_model = mo.convert_model(ONNX_CV_MODEL_PATH, reverse_input_channels=True)\n",
"```"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,7 @@
"metadata": {},
"outputs": [],
"source": [
"import platform\n",
"\n",
"if platform.system() != \"Windows\":\n",
" %pip install -q \"matplotlib>=3.4\"\n",
"else:\n",
" %pip install -q \"matplotlib>=3.4,<3.7\"\n",
"\n",
"%pip install -q --extra-index-url https://download.pytorch.org/whl/cpu requests pysbd transformers \"torch>=2.1\" \"openvino>=2023.1.0\" seaborn ipywidgets"
"%pip install -q --extra-index-url https://download.pytorch.org/whl/cpu requests pysbd transformers \"torch>=2.1\" \"openvino>=2023.1.0\" seaborn ipywidgets \"matplotlib>=3.4\""
]
},
{
Expand Down
Loading

0 comments on commit 095090d

Please sign in to comment.