Skip to content

Commit 0c94198

Browse files
Remove tensorflow-cpu to avoid conflicts (openvinotoolkit#2592)
CVS-158810 jax-classification-to-openvino.ipynb uses tensorflow-cpu. But after deleting tensorflow-cpu and tensorflow (pip uninstall), the tensorflow directory still exists, but contains only empty folders. Hence a lot of errors AttributeError. tensorflow still available for import but absolutely empty. This fix makes test_replace, that uninstall tensorflow-cpu after the notebook execution, then install tensorflow and uninstall it to remove it completely.
1 parent 0e68f5b commit 0c94198

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

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

+15
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,21 @@
515515
"for idx in preds.argsort()[:-11:-1]:\n",
516516
" print(f\"{preds[idx]:.5f} : {imagenet_labels[idx]}\", end=\"\")"
517517
]
518+
},
519+
{
520+
"cell_type": "code",
521+
"execution_count": null,
522+
"id": "979b3a21",
523+
"metadata": {
524+
"test_replace": {
525+
"# %pip uninstall -q -y \"tensorflow-cpu\" tensorflow tf_keras": "%pip uninstall -q -y \"tensorflow-cpu\" tensorflow tf_keras\n%pip install tensorflow\n%pip uninstall -y tensorflow"
526+
}
527+
},
528+
"outputs": [],
529+
"source": [
530+
"# Cleanup\n",
531+
"# %pip uninstall -q -y \"tensorflow-cpu\" tensorflow tf_keras"
532+
]
518533
}
519534
],
520535
"metadata": {

notebooks/whisper-subtitles-generation/whisper-subtitles-generation.ipynb

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
},
7777
{
7878
"cell_type": "code",
79-
"execution_count": 3,
79+
"execution_count": null,
8080
"metadata": {
8181
"tags": []
8282
},
@@ -90,7 +90,7 @@
9090
"%pip install -q -U \"openvino>=2024.5.0\" \"openvino-tokenizers>=2024.5.0\" \"openvino-genai>=2024.5.0\"\n",
9191
"%pip install -q \"python-ffmpeg<=1.0.16\" \"ffmpeg\" \"moviepy\" \"transformers>=4.45\" \"git+https://github.com/huggingface/optimum-intel.git\" \"torch>=2.1\" --extra-index-url https://download.pytorch.org/whl/cpu\n",
9292
"%pip install -q -U \"yt_dlp>=2024.8.6\" soundfile librosa jiwer packaging\n",
93-
"%pip install -q \"gradio>=4.19\" \"typing_extensions>=4.9\"\n",
93+
"%pip install -q -U \"gradio>=4.19\" \"typing_extensions>=4.9\"\n",
9494
"\n",
9595
"if platform.system() == \"Darwin\":\n",
9696
" %pip install -q \"numpy<2.0\"\n",
@@ -387,7 +387,7 @@
387387
},
388388
{
389389
"cell_type": "code",
390-
"execution_count": 8,
390+
"execution_count": null,
391391
"metadata": {},
392392
"outputs": [],
393393
"source": [
@@ -413,7 +413,7 @@
413413
" input_video = VideoFileClip(str(video_file))\n",
414414
" duration = input_video.duration\n",
415415
" audio_file = video_file.stem + \".wav\"\n",
416-
" input_video.audio.write_audiofile(audio_file, verbose=False, logger=None)\n",
416+
" input_video.audio.write_audiofile(audio_file, logger=None)\n",
417417
" with open(audio_file, \"rb\") as f:\n",
418418
" inputs = f.read()\n",
419419
" audio = ffmpeg_read(inputs, 16000)\n",

0 commit comments

Comments
 (0)