Skip to content

Commit 2e1a8f1

Browse files
Unify tensorflow version (#3086)
1 parent 61eb11a commit 2e1a8f1

File tree

14 files changed

+65
-78
lines changed

14 files changed

+65
-78
lines changed

.ci/skipped_notebooks.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@
200200
- macos-13
201201
- ubuntu-22.04
202202
- windows-2022
203+
- python:
204+
- '3.12'
203205
- notebook: notebooks/sound-generation-audioldm2/sound-generation-audioldm2.ipynb
204206
skips:
205207
- os:
@@ -236,6 +238,8 @@
236238
- macos-13
237239
- ubuntu-22.04
238240
- windows-2022
241+
- python:
242+
- '3.12'
239243
- notebook: notebooks/kosmos2-multimodal-large-language-model/kosmos2-multimodal-large-language-model.ipynb
240244
skips:
241245
- os:
@@ -336,6 +340,8 @@
336340
skips:
337341
- device:
338342
- gpu
343+
- python:
344+
- '3.12'
339345
- notebook: notebooks/hello-npu/hello-npu.ipynb
340346
skips:
341347
- device:
@@ -583,4 +589,32 @@
583589
- notebook: notebooks/flux.1-kontext/flux.1-kontext.ipynb
584590
skips:
585591
- os:
586-
- macos-13
592+
- macos-13
593+
- notebook: notebooks/convert-to-openvino/convert-to-openvino.ipynb
594+
skips:
595+
- python:
596+
- "3.12"
597+
- notebook: notebooks/jax-to-openvino/jax-classification-to-openvino.ipynb
598+
skips:
599+
- python:
600+
- "3.12"
601+
- notebook: notebooks/optimize-preprocessing/optimize-preprocessing.ipynb
602+
skips:
603+
- python:
604+
- "3.12"
605+
- notebook: notebooks/tensorflow-classification-to-openvino/tensorflow-classification-to-openvino.ipynb
606+
skips:
607+
- python:
608+
- "3.12"
609+
- notebook: notebooks/tensorflow-hub/tensorflow-hub.ipynb
610+
skips:
611+
- python:
612+
- "3.12"
613+
- notebook: notebooks/tensorflow-object-detection-to-openvino/tensorflow-object-detection-api-with-openvino.ipynb
614+
skips:
615+
- python:
616+
- "3.12"
617+
- notebook: notebooks/text-to-image-genai/text-to-image-genai.ipynb
618+
skips:
619+
- os:
620+
- macos-13

notebooks/big-transfer-quantization/tensorflow-bit-image-classification-nncf-quantization.ipynb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@
4242
"source": [
4343
"import platform\n",
4444
"\n",
45-
"%pip install -q \"tensorflow-macos==2.15.1; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version > '3.8'\" # macOS M1 and M2\n",
46-
"%pip install -q \"tensorflow==2.15.1; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version > '3.8'\" # macOS x86\n",
47-
"%pip install -q \"tensorflow==2.15.1; sys_platform != 'darwin' and python_version > '3.8'\"\n",
45+
"%pip install -q \"tensorflow==2.15.1\" \"tf_keras==2.15.1\"\n",
4846
"%pip install -q --no-deps \"tensorflow-hub==0.15.0\"\n",
49-
"%pip install -q \"openvino>=2024.0.0\" \"nncf==2.17.0\" \"tf_keras==2.15.1\"\n",
47+
"%pip install -q \"openvino>=2024.0.0\" \"nncf==2.17.0\"\n",
5048
"%pip install -q \"scikit-learn>=1.3.2\"\n",
5149
"\n",
5250
"if platform.system() != \"Windows\":\n",

notebooks/convert-to-openvino/convert-to-openvino.ipynb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@
4343
"outputs": [],
4444
"source": [
4545
"# Required imports. Please execute this cell first.\n",
46-
"%pip install -q \"tensorflow-macos>=2.5; sys_platform == 'darwin' and platform_machine == 'arm64'\"\n",
47-
"%pip install -q \"tensorflow>=2.5; sys_platform == 'darwin' and platform_machine != 'arm64'\"\n",
48-
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin'\"\n",
46+
"%pip install -q \"tensorflow==2.15.1\" \"tf_keras==2.15.1\"\n",
4947
"%pip install -q --no-deps \"tensorflow-hub\"\n",
5048
"%pip install -q --extra-index-url https://download.pytorch.org/whl/cpu \\\n",
51-
"\"openvino>=2024.4.0\" \"requests\" \"tqdm\" \"transformers>=4.31\" \"onnx!=1.16.2\" \"torch>=2.1\" \"torchvision\" \"tf_keras\""
49+
"\"openvino>=2024.4.0\" \"requests\" \"tqdm\" \"transformers>=4.31\" \"torch>=2.1\" \"torchvision\" \"onnx<1.16.2\""
5250
]
5351
},
5452
{

notebooks/film-slowmo/film-slowmo.ipynb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,7 @@
6868
"source": [
6969
"import os\n",
7070
"\n",
71-
"%pip install -q \"tensorflow-macos>=2.5; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version > '3.8'\" # macOS M1 and M2\n",
72-
"%pip install -q \"tensorflow-macos>=2.5,<=2.12.0; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version <= '3.8'\" # macOS M1 and M2\n",
73-
"%pip install -q \"tensorflow>=2.5; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version > '3.8'\" # macOS x86\n",
74-
"%pip install -q \"tensorflow>=2.5,<=2.12.0; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version <= '3.8'\" # macOS x86\n",
75-
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version > '3.8'\"\n",
76-
"%pip install -q \"tensorflow>=2.5,<=2.12.0; sys_platform != 'darwin' and python_version <= '3.8'\"\n",
77-
"\n",
71+
"%pip install -q \"tensorflow==2.15.1\" \"tf_keras==2.15.1\"\n",
7872
"%pip install -q --no-deps \"tensorflow-hub\"\n",
7973
"%pip install -q tf_keras numpy \"opencv-python\" tqdm \"gradio>=4.19\" Pillow \"openvino>=2023.2.0\"\n",
8074
"\n",

notebooks/jax-to-openvino/jax-classification-to-openvino.ipynb

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,17 @@
115115
"import platform\n",
116116
"\n",
117117
"%pip uninstall -q -y protobuf tensorflow-cpu jax jaxlib flax keras ml_dtypes\n",
118-
"pip_install(\"--pre\", \"-Uq\", \"openvino>=2024.5.0\", \"--extra-index-url\", \"https://storage.openvinotoolkit.org/simple/wheels/nightly\")\n",
118+
"pip_install(\"-Uq\", \"openvino>=2025.3.0\")\n",
119+
"\n",
119120
"\n",
120121
"if platform.system() == \"Darwin\":\n",
121-
" pip_install(\"-U\", \"numpy<2.0.0\")\n",
122122
" if platform.machine() == \"arm64\":\n",
123-
" pip_install(\"-U\", \"tensorflow-macos>=2.5\", \"jax-metal>=0.4.2,<0.6.0\", \"tensorboard\")\n",
123+
" pip_install(\"tensorflow==2.15.1\", \"tf_keras==2.15.1\", \"jax-metal>=0.4.2,<0.6.0\", \"tensorboard\")\n",
124124
" else:\n",
125-
" pip_install(\"-U\", \"tensorflow>=2.5\", \"jax>=0.4.2,<0.6.0\", \"tensorboard\")\n",
126-
" pip_install(\"Pillow\", \"absl-py>=0.12.0\", \"flax>=0.6.4\", \"pandas>=1.1.0\", \"tf_keras\", \"tqdm\", \"einops>=0.3.0\", \"ml-collections>=0.1.0\", \"numpy<2.0.0\")\n",
125+
" pip_install(\"tensorflow==2.15.1\", \"tf_keras==2.15.1\", \"jax>=0.4.2,<0.6.0\", \"tensorboard\")\n",
127126
"else:\n",
128-
" pip_install(\"-U\", \"tensorflow-cpu>=2.5\", \"jax>=0.4.2,<0.6.0\", \"tensorboard\")\n",
129-
" pip_install(\"Pillow\", \"absl-py>=0.12.0\", \"flax>=0.6.4\", \"pandas>=1.1.0\", \"tf_keras\", \"tqdm\", \"einops>=0.3.0\", \"ml-collections>=0.1.0\")"
127+
" pip_install(\"tensorflow==2.15.1\", \"tf_keras==2.15.1\", \"jax>=0.4.2,<0.6.0\", \"tensorboard\")\n",
128+
"pip_install(\"Pillow\", \"absl-py>=0.12.0\", \"flax>=0.6.4\", \"pandas>=1.1.0\", \"tqdm\", \"einops>=0.3.0\", \"ml-collections>=0.1.0\", \"numpy<2.0.0\")"
130129
]
131130
},
132131
{
@@ -552,13 +551,13 @@
552551
"id": "979b3a21",
553552
"metadata": {
554553
"test_replace": {
555-
"# %pip uninstall -q -y \"tensorflow-cpu\" tensorflow tf_keras": "%pip uninstall -q -y \"tensorflow-cpu\" tensorflow tf_keras jax jaxlib flax\n%pip install tensorflow\n%pip uninstall -y tensorflow"
554+
"# %pip uninstall -q -y \"tensorflow-cpu\" tensorflow tf_keras jax \"jax-metal\"": "%pip uninstall -q -y \"tensorflow-cpu\" tensorflow tf_keras jax \"jax-metal\""
556555
}
557556
},
558557
"outputs": [],
559558
"source": [
560559
"# Cleanup\n",
561-
"# %pip uninstall -q -y \"tensorflow-cpu\" tensorflow tf_keras"
560+
"# %pip uninstall -q -y \"tensorflow-cpu\" tensorflow tf_keras jax \"jax-metal\""
562561
]
563562
}
564563
],

notebooks/keras-with-openvino-backend/keras-with-openvino-backend.ipynb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@
5050
"cell_type": "code",
5151
"execution_count": null,
5252
"id": "b5b7aa41",
53-
"metadata": {
54-
"test_replace": {
55-
"from pathlib import Path\n": "from pathlib import Path\n%pip uninstall -q -y \"tensorflow-cpu\" tensorflow tf_keras jax jaxlib flax keras ml-dtypes tensorboard\n"
56-
}
57-
},
53+
"metadata": {},
5854
"outputs": [],
5955
"source": [
6056
"from pathlib import Path\n",

notebooks/optimize-preprocessing/optimize-preprocessing.ipynb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,15 @@
7373
},
7474
{
7575
"cell_type": "code",
76-
"execution_count": 1,
76+
"execution_count": null,
7777
"metadata": {},
7878
"outputs": [],
7979
"source": [
8080
"# Install openvino package\n",
8181
"%pip install -q \"openvino>=2023.1.0\" opencv-python tqdm \"matplotlib>=3.4\"\n",
8282
"\n",
83-
"%pip install -q \"tensorflow-macos>=2.5; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version > '3.8'\" # macOS M1 and M2\n",
84-
"%pip install -q \"tensorflow>=2.5; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version > '3.8'\" # macOS x86\n",
85-
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version > '3.8'\"\n",
86-
"%pip install -q --no-deps tensorflow_hub\n",
87-
"%pip install -q tf_keras"
83+
"%pip install -q \"tensorflow==2.15.1\" \"tf_keras==2.15.1\"\n",
84+
"%pip install -q --no-deps tensorflow_hub"
8885
]
8986
},
9087
{

notebooks/s3d-mil-nce-text-to-video-retrieval/s3d-mil-nce-text-to-video-retrieval.ipynb

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
"outputs": [],
5555
"source": [
5656
"import os\n",
57-
"import platform\n",
5857
"import requests\n",
5958
"\n",
6059
"from pathlib import Path\n",
@@ -78,22 +77,12 @@
7877
"\n",
7978
"\n",
8079
"pip_install(\"openvino-tokenizers\", \"openvino>=2025.2.0\")\n",
81-
"# Determine the correct tensorflow version for macOS\n",
82-
"if platform.system() == \"Darwin\":\n",
83-
" if platform.machine() == \"arm64\":\n",
84-
" pip_install(\"-q\", \"tensorflow==2.19.1\", \"tf_keras==2.19.0\")\n",
85-
" else:\n",
86-
" pip_install(\"-q\", \"tensorflow==2.16.2\", \"tf_keras==2.16.0\")\n",
87-
"else:\n",
88-
" pip_install(\"-q\", \"tensorflow==2.19.1\", \"tf_keras==2.19.0\")\n",
80+
"pip_install(\"-q\", \"tensorflow==2.15.1\", \"tf_keras==2.15.1\")\n",
8981
"\n",
9082
"pip_install(\"-q\", \"tensorflow_hub==0.16.1\", \"--no-deps\")\n",
91-
"pip_install(\"-q\", \"opencv-python\", \"nncf>=2.17.0\", \"numpy\")\n",
83+
"pip_install(\"-q\", \"opencv-python\", \"nncf>=2.17.0\", \"numpy<2\")\n",
9284
"pip_install(\"-q\", \"matplotlib>=3.4\")\n",
9385
"\n",
94-
"if platform.system() == \"Darwin\":\n",
95-
" pip_install(\"-q\", \"numpy<2\")\n",
96-
"\n",
9786
"\n",
9887
"# Read more about telemetry collection at https://github.com/openvinotoolkit/openvino_notebooks?tab=readme-ov-file#-telemetry\n",
9988
"from notebook_utils import collect_telemetry\n",

notebooks/stable-diffusion-keras-cv/stable-diffusion-keras-cv.ipynb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@
5050
},
5151
"outputs": [],
5252
"source": [
53-
"%pip install -q \"tensorflow-macos>=2.15; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version > '3.8'\" # macOS M1 and M2\n",
54-
"%pip install -q \"tensorflow>=2.15; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version > '3.8'\" # macOS x86\n",
55-
"%pip install -q \"tensorflow>=2.15; sys_platform != 'darwin' and python_version > '3.8'\"\n",
56-
"%pip install -q keras-cv tf_keras numpy \"openvino>=2024.1.0\" \"gradio>=4.19\" \"datasets<4.0.0\" \"nncf>=2.10.0\"\n",
53+
"%pip install -q \"tensorflow==2.15.1\" \"tf_keras==2.15.1\"\n",
54+
"%pip install -q keras-cv numpy \"openvino>=2024.1.0\" \"gradio>=4.19\" \"datasets<4.0.0\" \"nncf>=2.10.0\"\n",
5755
"\n",
5856
"%pip install -q \"matplotlib>=3.4\""
5957
]

notebooks/tensorflow-classification-to-openvino/tensorflow-classification-to-openvino.ipynb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,16 @@
4040
},
4141
{
4242
"cell_type": "code",
43-
"execution_count": 1,
43+
"execution_count": null,
4444
"metadata": {},
4545
"outputs": [],
4646
"source": [
4747
"# Install openvino package\n",
4848
"%pip install -q \"openvino>=2023.1.0\" \"opencv-python\"\n",
4949
"%pip install -q \"matplotlib>=3.4\"\n",
50-
"%pip install -q \"tensorflow-macos>=2.5; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version > '3.8'\" # macOS M1 and M2\n",
51-
"%pip install -q \"tensorflow>=2.5; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version > '3.8'\" # macOS x86\n",
52-
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version > '3.8'\"\n",
50+
"%pip install -q \"tensorflow==2.15.1\" \"tf_keras==2.15.1\"\n",
5351
"%pip install -q --no-deps tensorflow_hub\n",
54-
"%pip install -q tf_keras tqdm"
52+
"%pip install -q tqdm"
5553
]
5654
},
5755
{

0 commit comments

Comments
 (0)