התקנה
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
התקנת tensorflow_hub
ניתן להתקין את ספריית tensorflow_hub
לצד TensorFlow 1 ו- TensorFlow 2. אנו ממליצים למשתמשים חדשים להתחיל עם TensorFlow 2 מיד, ולמשתמשים נוכחיים לשדרג אליו.
השתמש עם TensorFlow 2
השתמש ב- pip כדי להתקין את TensorFlow 2 כרגיל. (ראה שם הוראות נוספות לגבי תמיכה ב-GPU.) לאחר מכן התקן גרסה נוכחית של tensorflow-hub
לידו (חייב להיות 0.5.0 ומעלה).
$ pip install "tensorflow>=2.0.0"
$ pip install --upgrade tensorflow-hub
ה-API בסגנון TF1 של TensorFlow Hub עובד עם מצב התאימות v1 של TensorFlow 2.
שימוש מדור קודם עם TensorFlow 1
TensorFlow 1.15 היא הגרסה היחידה של TensorFlow 1.x שעדיין נתמכת על ידי ספריית tensorflow_hub
(נכון לגרסה 0.11.0). TensorFlow 1.15 מוגדר כברירת מחדל להתנהגות תואמת TF1 אך מכיל תכונות TF2 רבות מתחת למכסה המנוע כדי לאפשר שימוש מסוים בממשקי API בסגנון TF2 של TensorFlow Hub.
$ pip install "tensorflow>=1.15,<2.0"
$ pip install --upgrade tensorflow-hub
שימוש בגרסאות טרום-הפצה
חבילות ה-pip tf-nightly
ו- tf-hub-nightly
בנויות אוטומטית מקוד המקור ב-github, ללא בדיקות שחרור. זה מאפשר למפתחים לנסות את הקוד העדכני ביותר מבלי לבנות ממקור .
$ pip install tf-nightly
$ pip install --upgrade tf-hub-nightly
השלבים הבאים
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[],[],null,["# Installation\n\nInstalling tensorflow_hub\n-------------------------\n\nThe `tensorflow_hub` library can be installed alongside TensorFlow 1 and\nTensorFlow 2. We recommend that new users start with TensorFlow 2 right away,\nand current users upgrade to it.\n\n### Use with TensorFlow 2\n\nUse [pip](https://pip.pypa.io/) to\n[install TensorFlow 2](https://www.tensorflow.org/install) as usual. (See there\nfor extra instructions about GPU support.) Then install a current version of\n[`tensorflow-hub`](https://pypi.org/project/tensorflow-hub/) next to it (must be\n0.5.0 or newer). \n\n $ pip install \"tensorflow\u003e=2.0.0\"\n $ pip install --upgrade tensorflow-hub\n\nThe TF1-style API of TensorFlow Hub works with the v1 compatibility mode of\nTensorFlow 2.\n\n### Legacy use with TensorFlow 1\n\nTensorFlow 1.15 is the only version of TensorFlow 1.x still supported by the\n`tensorflow_hub` library (as of release 0.11.0). TensorFlow 1.15 defaults to\nTF1-compatible behavior but contains many TF2 features under the hood to allow\nsome use of TensorFlow Hub's TF2-style APIs. \n\n $ pip install \"tensorflow\u003e=1.15,\u003c2.0\"\n $ pip install --upgrade tensorflow-hub\n\n### Use of pre-release versions\n\nThe pip packages `tf-nightly` and `tf-hub-nightly` are built automatically from\nthe source code on github, with no release testing. This lets developers try out\nthe latest code without [building from source](/hub/build_from_source). \n\n $ pip install tf-nightly\n $ pip install --upgrade tf-hub-nightly\n\nNext Steps\n----------\n\n- [Library overview](/hub/lib_overview)\n- Tutorials:\n - [Text classification](https://github.com/tensorflow/docs/blob/master/site/en/hub/tutorials/tf2_text_classification.ipynb)\n - [Image classification](https://github.com/tensorflow/docs/blob/master/site/en/hub/tutorials/tf2_image_retraining.ipynb)\n - Additional examples [on GitHub](https://github.com/tensorflow/hub/blob/master/examples/README.md)\n- Find models on [tfhub.dev](https://tfhub.dev)."]]