Skip to content

Commit 21a745a

Browse files
check incompatible versions (#2679)
CVS-159054 Install `tensorflow-hub` with `--no-deps`, because it install `tensorflow` even if `tensorflow-macos` is installed. Update tensorflow versions in tensorflow-quantization-aware-training.ipynb due to updated versions in nncf. Also this notebook is excluded from ci launch due to the fact that the latest version with that nncf can work doesn't support python3.12. Add `test_replace` to uninstall `tf_keras` that can cause incompatibility problems in non-tensorflow notebooks.
1 parent 5f58a1c commit 21a745a

File tree

10 files changed

+47
-15
lines changed

10 files changed

+47
-15
lines changed

.ci/skipped_notebooks.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,4 +565,8 @@
565565
- macos-13
566566
- ubuntu-20.04
567567
- ubuntu-22.04
568-
- windows-2019
568+
- windows-2019
569+
- notebook: notebooks/tensorflow-quantization-aware-training/tensorflow-quantization-aware-training.ipynb
570+
skips:
571+
- python:
572+
- '3.12'

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"%pip install -q \"tensorflow-macos>=2.5; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version > '3.8'\" # macOS M1 and M2\n",
4646
"%pip install -q \"tensorflow>=2.5; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version > '3.8'\" # macOS x86\n",
4747
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version > '3.8'\"\n",
48-
"\n",
49-
"%pip install -q \"openvino>=2024.0.0\" \"nncf>=2.7.0\" \"tensorflow-hub>=0.15.0\" tf_keras\n",
48+
"%pip install -q --no-deps \"tensorflow-hub>=0.15.0\"\n",
49+
"%pip install -q \"openvino>=2024.0.0\" \"nncf>=2.7.0\" tf_keras\n",
5050
"%pip install -q \"scikit-learn>=1.3.2\"\n",
5151
"\n",
5252
"if platform.system() != \"Windows\":\n",

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@
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",
49+
"%pip install -q --no-deps \"tensorflow-hub\"\n",
4650
"%pip install -q --extra-index-url https://download.pytorch.org/whl/cpu \\\n",
47-
"\"openvino>=2024.4.0\" \"requests\" \"tqdm\" \"transformers>=4.31\" \"onnx!=1.16.2\" \"torch>=2.1\" \"torchvision\" \"tensorflow_hub\" \"tensorflow\""
51+
"\"openvino>=2024.4.0\" \"requests\" \"tqdm\" \"transformers>=4.31\" \"onnx!=1.16.2\" \"torch>=2.1\" \"torchvision\" \"tf_keras\""
4852
]
4953
},
5054
{

notebooks/film-slowmo/film-slowmo.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version > '3.8'\"\n",
7676
"%pip install -q \"tensorflow>=2.5,<=2.12.0; sys_platform != 'darwin' and python_version <= '3.8'\"\n",
7777
"\n",
78-
"\n",
79-
"%pip install -q tensorflow_hub tf_keras numpy \"opencv-python\" tqdm \"gradio>=4.19\" Pillow \"openvino>=2023.2.0\"\n",
78+
"%pip install -q --no-deps \"tensorflow-hub\"\n",
79+
"%pip install -q tf_keras numpy \"opencv-python\" tqdm \"gradio>=4.19\" Pillow \"openvino>=2023.2.0\"\n",
8080
"\n",
8181
"%pip install -q \"matplotlib>=3.4\""
8282
]

notebooks/optimize-preprocessing/optimize-preprocessing.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
"%pip install -q \"tensorflow-macos>=2.5; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version > '3.8'\" # macOS M1 and M2\n",
8484
"%pip install -q \"tensorflow>=2.5; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version > '3.8'\" # macOS x86\n",
8585
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version > '3.8'\"\n",
86-
"%pip install -q tf_keras tensorflow_hub"
86+
"%pip install -q --no-deps tensorflow_hub\n",
87+
"%pip install -q tf_keras"
8788
]
8889
},
8990
{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
"%pip install -q \"tensorflow>=2.5; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version > '3.8'\" # macOS x86\n",
5959
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version > '3.8'\"\n",
6060
"\n",
61-
"%pip install -q tensorflow_hub tf_keras numpy \"opencv-python\" \"nncf>=2.10.0\"\n",
61+
"%pip install -q --no-deps tensorflow_hub\n",
62+
"%pip install -q tf_keras numpy \"opencv-python\" \"nncf>=2.10.0\"\n",
6263
"%pip install -q \"matplotlib>=3.4\""
6364
]
6465
},

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
"%pip install -q \"tensorflow-macos>=2.5; sys_platform == 'darwin' and platform_machine == 'arm64' and python_version > '3.8'\" # macOS M1 and M2\n",
5151
"%pip install -q \"tensorflow>=2.5; sys_platform == 'darwin' and platform_machine != 'arm64' and python_version > '3.8'\" # macOS x86\n",
5252
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin' and python_version > '3.8'\"\n",
53-
"%pip install -q tf_keras tensorflow_hub tqdm"
53+
"%pip install -q --no-deps tensorflow_hub\n",
54+
"%pip install -q tf_keras tqdm"
5455
]
5556
},
5657
{

notebooks/tensorflow-hub/tensorflow-hub.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@
6363
"%pip install -q \"tensorflow-macos>=2.5; sys_platform == 'darwin' and platform_machine == 'arm64'\"\n",
6464
"%pip install -q \"tensorflow>=2.5; sys_platform == 'darwin' and platform_machine != 'arm64'\"\n",
6565
"%pip install -q \"tensorflow>=2.5; sys_platform != 'darwin'\"\n",
66-
"%pip install -q tf_keras tensorflow_hub"
66+
"%pip install -q --no-deps tensorflow_hub\n",
67+
"%pip install -q tf_keras"
6768
]
6869
},
6970
{

notebooks/tensorflow-quantization-aware-training/tensorflow-quantization-aware-training.ipynb

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@
7272
"metadata": {},
7373
"outputs": [],
7474
"source": [
75-
"%pip install -q \"openvino>=2024.0.0\" \"nncf>=2.9.0\"\n",
76-
"%pip install -q \"tensorflow-macos>=2.5,<=2.12.0; sys_platform == 'darwin' and platform_machine == 'arm64'\"\n",
77-
"%pip install -q \"tensorflow>=2.5,<=2.12.0; sys_platform == 'darwin' and platform_machine != 'arm64'\" # macOS x86\n",
78-
"%pip install -q \"tensorflow>=2.5,<=2.12.0; sys_platform != 'darwin'\"\n",
75+
"%pip install -q \"openvino>=2024.6.0\" \"nncf>=2.14.0\"\n",
76+
"%pip install -q \"tensorflow-macos>=2.9.3,<2.16.0; sys_platform == 'darwin' and platform_machine == 'arm64'\"\n",
77+
"%pip install -q \"tensorflow>=2.9.3,<2.16.0; sys_platform == 'darwin' and platform_machine != 'arm64'\" # macOS x86\n",
78+
"%pip install -q \"tensorflow>=2.9.3,<2.16.0; sys_platform != 'darwin'\"\n",
7979
"%pip install -q \"tensorflow-datasets>=4.9.0,<4.9.3; platform_system=='Windows'\"\n",
8080
"%pip install -q \"tensorflow-datasets>=4.9.0\""
8181
]
@@ -696,6 +696,21 @@
696696
"core = ov.Core()\n",
697697
"core.get_property(device.value, props.device.full_name)"
698698
]
699+
},
700+
{
701+
"cell_type": "code",
702+
"execution_count": null,
703+
"id": "a5d0d9e3",
704+
"metadata": {
705+
"test_replace": {
706+
"# %pip uninstall -q -y tensorflow tf_keras": "%pip uninstall -q -y tensorflow tf_keras \"tensorflow-macos\""
707+
}
708+
},
709+
"outputs": [],
710+
"source": [
711+
"# Cleanup\n",
712+
"# %pip uninstall -q -y tensorflow tf_keras"
713+
]
699714
}
700715
],
701716
"metadata": {

notebooks/text-to-image-genai/text-to-image-genai.ipynb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@
5151
"cell_type": "code",
5252
"execution_count": 1,
5353
"id": "a292e4d0-8dc9-407e-94e7-fc777430bfd4",
54-
"metadata": {},
54+
"metadata": {
55+
"test_replace": {
56+
"%pip install -q \"git+https://github.com/huggingface/optimum-intel.git\"\n": "%pip uninstall -q -y tensorflow tf_keras\n%pip install -q \"git+https://github.com/huggingface/optimum-intel.git\"\n"
57+
}
58+
},
5559
"outputs": [],
5660
"source": [
5761
"import platform\n",
@@ -60,6 +64,7 @@
6064
"\n",
6165
"\n",
6266
"%pip install -q \"git+https://github.com/huggingface/optimum-intel.git\"\n",
67+
"\n",
6368
"%pip install -q -U --pre --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly \"openvino>=2024.5\" \"openvino-tokenizers>=2024.5\" \"openvino-genai>=2024.5\"\n",
6469
"%pip install -q -U \"transformers>=4.45\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
6570
"%pip install -q Pillow \"diffusers>=0.30.3\" \"gradio>=4.19\" \"typing_extensions>=4.9\" \"tqdm\"\n",

0 commit comments

Comments
 (0)