CINXE.COM

隆重推出 KerasHub:适用于预训练模型的一站式商店 - Google Developers Blog

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title> 隆重推出 KerasHub:适用于预训练模型的一站式商店 - Google Developers Blog </title> <meta property="og:title" content="隆重推出 KerasHub:适用于预训练模型的一站式商店- Google Developers Blog" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="description" content="KerasHub is a new unified library for pretrained models fostering a more cohesive ecosystem for developers." /> <meta content="summary_large_image" name="twitter:card"/> <meta content="Google for Developers Blog - News about Web, Mobile, AI and Cloud" property="twitter:title"/> <meta property="og:title" content="隆重推出 KerasHub:适用于预训练模型的一站式商店" /> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{ "@type": "ListItem", "position": 1, "name": "Google for Developers Blog", "item": "https://developers.googleblog.com/" },{ "@type": "ListItem", "position": 2, "name": "隆重推出 KerasHub:适用于预训练模型的一站式商店", "item": "http://developers.googleblog.com/zh-hans/introducing-keras-hub-for-pretrained-models/" }] } </script> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Article", "headline": "隆重推出 KerasHub:适用于预训练模型的一站式商店", "description": "KerasHub 是一个用于预训练模型的全新统一库,旨在为开发者打造一个更具凝聚力的生态系统。", "image": "https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Keras-GfD.2e16d0ba.fill-800x400.png", "datePublished": "2024-10-22", "author": [ { "@type": "Person", "name": "Divyashree Sreepathihalli", "url": "/zh-hans/search/?author=Divyashree+Sreepathihalli" }, { "@type": "Person", "name": "Luciano Martins", "url": "/zh-hans/search/?author=Luciano+Martins" } ] } </script> <meta content="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Keras-GfD.2e16d0ba.fill-1200x600.png" property="og:image"/> <!-- Google Tag Manager --> <script type="text/javascript" src="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/js/analytics.js"></script> <!-- End Google Tag Manager --> <link href="//www.gstatic.com/glue/v27_1/glue.min.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/css/dgc_blog.css"> <link rel="icon" href="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/images/favicon.ico" type="image/x-icon"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preload" href="https://fonts.googleapis.com/css2?family=Product+Sans&family=Google+Sans+Display:ital@0;1&family=Google+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&family=Google+Sans+Text:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap" as="style"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Product+Sans&family=Google+Sans+Display:ital@0;1&family=Google+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&family=Google+Sans+Text:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400&display=swap"> <link href="https://www.gstatic.com/glue/cookienotificationbar/cookienotificationbar.min.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/css/blog_detail.css" /> <link rel="stylesheet" href="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/pygmentify/css/default.min.css"> </head> <body id="main-content" class="glue-body "> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WVTLDSL " height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <!-- HTML --> <header class="dgc-header"> <div class="dgc-header-inner"> <button class="hamburger" aria-haspopup="true" aria-expanded="false" aria-label="打开菜单"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#menu"></use> </svg> </button> <div class="product-name-wrapper"> <a href="https://developers.google.com/" class="site-logo-link" data-label="Site logo"> <img src="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/images/g-dev.svg" class="site-logo" alt="Google for Developers"> </a> </div> <div class="desktop-nav-wrapper"> <div class="upper-tabs-wrapper"> <div class="upper-tabs"> <nav class="tabs" aria-label="上层标签页"> <div class="tab" dropdown> <a href="//developers.google.com/products" class="top-nav-title"> 产品 </a> <a href="#" role="button" aria-haspopup="true" aria-expanded="true" aria-label="产品的下拉菜单" class="dropdown-toggle"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#arrow-drop-down"></use> </svg> </a> <div class="tabs-dropdown" aria-label="子菜单"> <div class="tabs-dropdown-content"> <div class="tabs-dropdown-column"> <ul class="tabs-dropdown-section"> <li class="nav-title" aria-label="开发菜单">开发</li> <li class="nav-item"> <a href="//developer.android.com"> <div class="nav-item-title"> Android </div> </a> </li> <li class="nav-item"> <a href="//developer.chrome.com"> <div class="nav-item-title"> Chrome </div> </a> </li> <li class="nav-item"> <a href="//chromeos.dev/"> <div class="nav-item-title"> ChromeOS </div> </a> </li> <li class="nav-item"> <a href="//cloud.google.com"> <div class="nav-item-title"> Cloud </div> </a> </li> <li class="nav-item"> <a href="//firebase.google.com"> <div class="nav-item-title"> Firebase </div> </a> </li> <li class="nav-item"> <a href="//flutter.dev"> <div class="nav-item-title"> Flutter </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/assistant"> <div class="nav-item-title"> Google Assistant </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/maps"> <div class="nav-item-title"> Google Maps Platform </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/workspace"> <div class="nav-item-title"> Google Workspace </div> </a> </li> <li class="nav-item"> <a href="//www.tensorflow.org"> <div class="nav-item-title"> TensorFlow </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/youtube"> <div class="nav-item-title"> YouTube </div> </a> </li> </ul> </div> <div class="tabs-dropdown-column"> <ul class="tabs-dropdown-section"> <li class="nav-title" aria-label="增长 (Grow) 菜单">增长 (Grow)</li> <li class="nav-item"> <a href="//firebase.google.com"> <div class="nav-item-title"> Firebase </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/google-ads"> <div class="nav-item-title"> Google Ads </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/analytics"> <div class="nav-item-title"> Google Analytics </div> </a> </li> <li class="nav-item"> <a href="//developer.android.com/distribute"> <div class="nav-item-title"> Google Play </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/search"> <div class="nav-item-title"> Search </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/web/fundamentals/engage-and-retain/push-notifications"> <div class="nav-item-title"> Web Push and Notification APIs </div> </a> </li> </ul> </div> <div class="tabs-dropdown-column"> <ul class="tabs-dropdown-section"> <li class="nav-title" aria-label="获取菜单">获利</li> <li class="nav-item"> <a href="//developers.google.com/admob"> <div class="nav-item-title"> AdMob </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/google-ads/api"> <div class="nav-item-title"> Google Ads API </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/pay"> <div class="nav-item-title"> Google Pay </div> </a> </li> <li class="nav-item"> <a href="//developer.android.com/google/play/billing/"> <div class="nav-item-title"> Google Play Billing </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/interactive-media-ads"> <div class="nav-item-title"> Interactive Media Ads </div> </a> </li> </ul> </div> </div> </div> </div> <div class="tab"> <a href="//developers.google.com/solutions/catalog" class="top-nav-title"> 解决方法 </a> </div> <div class="tab"> <a href="//developers.google.com/events" class="top-nav-title"> 事件 </a> </div> <div class="tab"> <a href="//developers.google.com/learn" class="top-nav-title"> 学习 </a> </div> <div class="tab" dropdown> <a href="//developers.google.com/community" class="top-nav-title"> 社区 </a> <a href="#" role="button" aria-haspopup="true" aria-expanded="true" aria-label="社区的下拉菜单" class="dropdown-toggle"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#arrow-drop-down"></use> </svg> </a> <div class="tabs-dropdown" aria-label="子菜单"> <div class="tabs-dropdown-content"> <div class="tabs-dropdown-column"> <ul class="tabs-dropdown-section"> <li class="nav-title" aria-label="分组菜单">分组</li> <li class="nav-item"> <a href="//developers.google.com/community/gdg"> <div class="nav-item-title"> Google Developer Groups </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/gdsc"> <div class="nav-item-title"> Google Developer Student Clubs </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/womentechmakers"> <div class="nav-item-title"> Woman Techmakers </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/experts"> <div class="nav-item-title"> Google Developer Experts </div> </a> </li> <li class="nav-item"> <a href="//www.techequitycollective.com/"> <div class="nav-item-title"> Tech Equity Collective </div> </a> </li> </ul> </div> <div class="tabs-dropdown-column"> <ul class="tabs-dropdown-section"> <li class="nav-title" aria-label="计划菜单">计划</li> <li class="nav-item"> <a href="//developers.google.com/community/accelerators"> <div class="nav-item-title"> Accelerator </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/gdsc-solution-challenge"> <div class="nav-item-title"> Solution Challenge </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/devfest"> <div class="nav-item-title"> DevFest </div> </a> </li> </ul> </div> <div class="tabs-dropdown-column"> <ul class="tabs-dropdown-section"> <li class="nav-title" aria-label="案例菜单">案例</li> <li class="nav-item"> <a href="//developers.google.com/community/stories"> <div class="nav-item-title"> 所有案例 </div> </a> </li> </ul> </div> </div> </div> </div> <div class="tab"> <a href="//developers.google.com/profile/u/me" class="top-nav-title"> 开发者计划 </a> </div> <div class="tab"> <a href="//developers.googleblog.com/" class="top-nav-title"> 博客 </a> </div> </nav> </div> </div> </div> </div> <div class="dgc-header-search"> <div class="search-wrapper glue-page"> <div class="glue-grid"> <form id="search-form" action="/zh-hans/search/" method="get" class="search-content glue-grid__col glue-grid__col--span-4-sm glue-grid__col--span-9-md glue-grid__col--span-7-lg"> <div class="search-input-wrapper"> <svg role="presentation" aria-hidden="true" class="glue-icon search-icon"> <use href="/glue-icon/#search"></use> </svg> <input type="text" name="query" placeholder="搜索所有文章……" aria-label="搜索" class="search-input-field" /> </div> <button class="glue-button glue-button--high-emphasis"> 搜索 </button> </form> <div class="language-selector glue-grid__col glue-grid__col--span-4-sm glue-grid__col--span-3-md glue-grid__col--span-5-lg" aria-label="选择您的语言偏好"> <button type="button" aria-controls="lang-menu-header" aria-haspopup="true"> <svg role="presentation" aria-hidden="true" class="glue-icon lang-icon"> <use href="/glue-icon/#language"></use> </svg> <span class="lang-label">简体中文</span> <svg role="presentation" aria-hidden="true" class="glue-icon lang-icon"> <use href="/glue-icon/#arrow-drop-down"></use> </svg> </button> <div id="lang-menu-header" class="lang-menu hidden" role="menu"> <ul role="presentation"> <li role="presentation"> <a role="menuitem" lang="en" href="/en/introducing-keras-hub-for-pretrained-models/">English</a> </li> <li role="presentation"> <a role="menuitem" lang="es" href="/es/introducing-keras-hub-for-pretrained-models/">Español (Latam)</a> </li> <li role="presentation"> <a role="menuitem" lang="id" href="/id/introducing-keras-hub-for-pretrained-models/">Bahasa Indonesia</a> </li> <li role="presentation"> <a role="menuitem" lang="ja" href="/ja/introducing-keras-hub-for-pretrained-models/">日本語</a> </li> <li role="presentation"> <a role="menuitem" lang="ko" href="/ko/introducing-keras-hub-for-pretrained-models/">한국어</a> </li> <li role="presentation"> <a role="menuitem" lang="pt-br" href="/pt-br/introducing-keras-hub-for-pretrained-models/">Português (Brasil)</a> </li> <li role="presentation"> <a role="menuitem" lang="zh-hans" aria-current="true" href="/zh-hans/introducing-keras-hub-for-pretrained-models/">简体中文</a> </li> </ul> </div> </div> </div> </div> </div> </header> <div class="mobile-drawer" top-level-nav> <nav class="nav-content" aria-label="侧边菜单"> <div class="mobile-header"> <button class="nav-close-btn nav-btn" aria-label="关闭导航"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#close"></use> </svg> </button> <button class="nav-back-btn nav-btn hidden" aria-label="返回菜单"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#arrow-back"></use> </svg> </button> <div class="product-name-wrapper"> <a href="https://developers.google.com/" class="site-logo-link" data-label="Site logo"> <img src="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/images/g-dev.svg" class="site-logo" alt="Google for Developers"> </a> </div> </div> <div class="nav-wrapper"> <div class="mobile-nav-top"> <ul class="nav-list"> <li class="nav-item"> <a href="//developers.google.com/products" class="nav-title" data-label="Tab: Products"> <span class="nav-text" tooltip=""> 产品 </span> </a> <ul class="nav-responsive-tabs"> <li class="nav-item"> <span tabindex="0" class="nav-title products-btn" data-label="More Products"> <span class="nav-text" menu="Products"> 更多 </span> <span class="nav-icon" menu="Products"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#arrow-forward"></use> </svg> </span> </span> </li> </ul> </li> <li class="nav-item"> <a href="//developers.google.com/solutions/catalog" class="nav-title" data-label="Tab: Solutions"> <span class="nav-text" tooltip=""> 解决方法 </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/events" class="nav-title" data-label="Tab: Events"> <span class="nav-text" tooltip=""> 事件 </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/learn" class="nav-title" data-label="Tab: Learn"> <span class="nav-text" tooltip=""> 学习 </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community" class="nav-title" data-label="Tab: Community"> <span class="nav-text" tooltip=""> 社区 </span> </a> <ul class="nav-responsive-tabs"> <li class="nav-item"> <span tabindex="0" class="nav-title community-btn" data-label="More Community"> <span class="nav-text" menu="Community"> 更多 </span> <span class="nav-icon" menu="Community"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#arrow-forward"></use> </svg> </span> </span> </li> </ul> </li> <li class="nav-item"> <a href="//developers.google.com/profile/u/me" class="nav-title" data-label="Tab: Developer Program"> <span class="nav-text" tooltip=""> 开发者计划 </span> </a> </li> <li class="nav-item"> <a href="//developers.googleblog.com/" class="nav-title" data-label="Tab: Blog"> <span class="nav-text" tooltip=""> Blog </span> </a> </li> </ul> </div> <div class="mobile-nav-bottom"> <ul class="nav-list products-submenu" menu="Products" aria-label="侧边菜单"> <li class="nav-item nav-heading"> <span class="nav-title"> <span class="nav-text"> 开发 </span> </span> </li> <li class="nav-item"> <a href="//developer.android.com" class="nav-title"> <span class="nav-text"> Android </span> </a> </li> <li class="nav-item"> <a href="//developer.chrome.com" class="nav-title"> <span class="nav-text"> Chrome </span> </a> </li> <li class="nav-item"> <a href="//chromeos.dev/" class="nav-title"> <span class="nav-text"> ChromeOS </span> </a> </li> <li class="nav-item"> <a href="//cloud.google.com" class="nav-title"> <span class="nav-text"> Cloud </span> </a> </li> <li class="nav-item"> <a href="//firebase.google.com" class="nav-title"> <span class="nav-text"> Firebase </span> </a> </li> <li class="nav-item"> <a href="//flutter.dev" class="nav-title"> <span class="nav-text"> Flutter </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/assistant" class="nav-title"> <span class="nav-text"> Google Assistant </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/maps" class="nav-title"> <span class="nav-text"> Google Maps Platform </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/workspace" class="nav-title"> <span class="nav-text"> Google Workspace </span> </a> </li> <li class="nav-item"> <a href="//www.tensorflow.org" class="nav-title"> <span class="nav-text"> TensorFlow </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/youtube" class="nav-title"> <span class="nav-text"> YouTube </span> </a> </li> <li class="nav-item nav-heading"> <span class="nav-title"> <span class="nav-text"> 增长 (Grow) </span> </span> </li> <li class="nav-item"> <a href="//firebase.google.com" class="nav-title"> <span class="nav-text"> Firebase </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/google-ads" class="nav-title"> <span class="nav-text"> Google Ads </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/analytics" class="nav-title"> <span class="nav-text"> Google Analytics </span> </a> </li> <li class="nav-item"> <a href="//developer.android.com/distribute" class="nav-title"> <span class="nav-text"> Google Play </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/search" class="nav-title"> <span class="nav-text"> Search </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/web/fundamentals/engage-and-retain/push-notifications" class="nav-title"> <span class="nav-text"> Web Push and Notification APIs </span> </a> </li> <li class="nav-item nav-heading"> <span class="nav-title"> <span class="nav-text"> 获利 </span> </span> </li> <li class="nav-item"> <a href="//developers.google.com/admob" class="nav-title"> <span class="nav-text"> AdMob </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/google-ads/api" class="nav-title"> <span class="nav-text"> Google Ads API </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/pay" class="nav-title"> <span class="nav-text"> Google Pay </span> </a> </li> <li class="nav-item"> <a href="//developer.android.com/google/play/billing/" class="nav-title"> <span class="nav-text"> Google Play Billing </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/interactive-media-ads" class="nav-title"> <span class="nav-text"> Interactive Media Ads </span> </a> </li> </ul> <ul class="nav-list community-submenu hidden" menu="Community" aria-label="侧边菜单"> <li class="nav-item nav-heading"> <span class="nav-title"> <span class="nav-text"> 分组 </span> </span> </li> <li class="nav-item"> <a href="//developers.google.com/community/gdg" class="nav-title"> <span class="nav-text"> Google Developer Groups </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/gdsc" class="nav-title"> <span class="nav-text"> Google Developer Student Clubs </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/womentechmakers" class="nav-title"> <span class="nav-text"> Woman Techmakers </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/experts" class="nav-title"> <span class="nav-text"> Google Developer Experts </span> </a> </li> <li class="nav-item"> <a href="//www.techequitycollective.com/" class="nav-title"> <span class="nav-text"> Tech Equity Collective </span> </a> </li> <li class="nav-item nav-heading"> <span class="nav-title"> <span class="nav-text"> 计划 </span> </span> </li> <li class="nav-item"> <a href="//developers.google.com/community/accelerators" class="nav-title"> <span class="nav-text"> Accelerator </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/gdsc-solution-challenge" class="nav-title"> <span class="nav-text"> Solution Challenge </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/devfest" class="nav-title"> <span class="nav-text"> DevFest </span> </a> </li> <li class="nav-item nav-heading"> <span class="nav-title"> <span class="nav-text"> 案例 </span> </span> </li> <li class="nav-item"> <a href="//developers.google.com/community/stories" class="nav-title" aria-label="All Stories"> <span class="nav-text"> 所有案例 </span> </a> </li> </ul> </div> </div> </nav> <select aria-label="更改语言" name="lang-selector" id="lang-selector-nav" class="glue-form__dropdown glue-mobile-nav__lang-dropdown" onchange="window.location.href=this.value" > <option value="/en/introducing-keras-hub-for-pretrained-models/" lang="en" > English </option> <option value="/es/introducing-keras-hub-for-pretrained-models/" lang="es" > Español (Latam) </option> <option value="/id/introducing-keras-hub-for-pretrained-models/" lang="id" > Bahasa Indonesia </option> <option value="/ja/introducing-keras-hub-for-pretrained-models/" lang="ja" > 日本語 </option> <option value="/ko/introducing-keras-hub-for-pretrained-models/" lang="ko" > 한국어 </option> <option value="/pt-br/introducing-keras-hub-for-pretrained-models/" lang="pt-br" > Português (Brasil) </option> <option value="/zh-hans/introducing-keras-hub-for-pretrained-models/" lang="zh-hans" selected > 简体中文 </option> </select> </div> <div class="backdrop"></div> <div class="blog-detail-container"> <section class="tags-container glue-page glue-spacer-5-top"> <div class="glue-eyebrow"><a href="/zh-hans/search/?product_categories=Gemma">Gemma</a></div> </section> <section class="heading-container glue-page glue-spacer-1-top"> <h1 class="glue-headline glue-headline--headline-1">隆重推出 KerasHub:适用于预训练模型的一站式商店</h1> </section> <section class="summary-container glue-page glue-spacer-4-top"> <div class="date-time"> <div class="published-date glue-font-weight-medium">十月 22, 2024</div> </div> </section> <section class="glue-page glue-grid glue-spacer-1-top"> <section class="author-container glue-grid__col glue-grid__col--span-4-sm glue-grid__col--span-10-md"> <div class="author-obj"> <a class="glue-font-weight-medium" href="/zh-hans/search/?author=Divyashree+Sreepathihalli">Divyashree Sreepathihalli</a> <span class="glue-font-weight-medium role">Software Engineer</span> </div> <div class="author-obj"> <a class="glue-font-weight-medium" href="/zh-hans/search/?author=Luciano+Martins">Luciano Martins</a> <span class="glue-font-weight-medium role">Developer Advocate</span> <span class="glue-font-weight-medium team">Google AI</span> </div> </section> <section class="social-container glue-grid__col glue-grid__col--span-4-sm glue-grid__col--span-2-md"> <button id="social-button" class="glue-button glue-button--low-emphasis glue-button--icon" aria-haspopup="true" aria-expanded="false"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#share"></use> </svg> <span>分享</span> </button> <ul id="social-menu" class="glue-elevation-level-1" role="menu" aria-labelledby="social-button"> <li> <a href="https://www.facebook.com/sharer/sharer.php?u={url}" title="Share on Facebook" target="_blank" rel="noopener"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--social glue-icon--32px"> <use href="/glue-icon/#post-facebook"></use> </svg> <span>Facebook</span> </a> </li> <li> <a href="https://twitter.com/intent/tweet?text={url}" title="Share on Twitter" target="_blank" rel="noopener"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--social glue-icon--32px"> <use href="/glue-icon/#twitter-x"></use> </svg> <span>Twitter</span> </a> </li> <li> <a href="https://www.linkedin.com/shareArticle?url={url}&amp;mini=true" title="Share on LinkedIn" target="_blank" rel="noopener"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--social glue-icon--32px"> <use href="/glue-icon/#post-linkedin"></use> </svg> <span>LinkedIn</span> </a> </li> <li> <a href="mailto:name@example.com?subject=Check%20out%20this%20site&body=Check%20out%20{url}" title="Send via Email"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--social glue-icon--32px"> <use href="/glue-icon/#email"></use> </svg> <span>Mail</span> </a> </li> <li> <a href="#" title="Get shareable link" data-link="" data-copy-text="复制链接" data-copied-text="复制成功!"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--social glue-icon--32px"> <use href="/glue-icon/#link"></use> </svg> <span></span> </a> </li> </ul> </section> </section> <section class="blocks-container glue-page glue-spacer-3-top"> <div class="block"> <img class="banner-image" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Keras-GfD-Banner.original.png" alt="Keras on Google for Developers - banner" /> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">深度学习行业正在迅速发展,预训练模型对于处理广泛的任务变得越来越重要。Keras 以其人性化的 API 和注重可访问性而闻名,不仅一直处于这一运动的最前沿,而且拥有专门的库,如用于文本类模型的 KerasNLP 和用于计算机视觉模型的 KerasCV。</p><p data-block-key="as7cn">然而,由于模型导致模态之间的界限变得越来越模糊(想一想利用文本编码器处理图像输入或视觉任务的强大聊天 LLM),维护这些单独的域变得不太实际。NLP 和 CV 之间的分歧可能会阻碍真正多模态模型的开发和部署,从而导致工作变得冗余以及用户体验不完整。</p> </div> <div class="inner-block-content"> <div class="image-wrapper"> <img class="regular-image" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/image3_ljbDif4.original.png" alt="keras-team/keras-hub, a unified, comprehensive library for pretrained models" /> </div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">为了解决这个问题,我们很高兴地宣布 Keras 生态系统的重大变革:<a href="https://keras.io/keras_hub/">KerasHub</a> 是一个统一、全面的预训练模型库,可简化对尖端 NLP 和 CV 架构的访问。KerasHub 是一个中央存储区,您可以其中无缝探索并利用 BERT 等最先进的模型进行文本分析,以及利用 EfficientNet 进行图像分类,一切操作都在一致且熟悉的 Keras 框架内完成。</p><h3 data-block-key="620os"><br/><b>统一的开发者体验</b></h3><p data-block-key="fklj1">这种统一不仅可以简化模型的发现和使用,而且还有助于打造更具凝聚力的生态系统。借助 KerasHub,您可以利用各项高级功能,如轻松发布和共享模型、通过 LoRA 微调实现高效采用、进行量化以优化性能以及通过强大的多主机培训来处理大规模数据集,所有这些都适用于各种模态。这标志着向实现强大 AI 工具民主化和加速创新多模态应用开发迈出了重要一步。</p><h3 data-block-key="6vq37"><br/><b>使用 KerasHub 的第一步</b></h3><p data-block-key="8n85p">让我们开始在您的系统上安装 KerasHub。在 KerasHub 中,您可以探索大量<a href="https://keras.io/api/keras_hub/models/">可用的模型</a>和各种不同的热门架构部署方式。然后,您就可以轻松加载这些预训练模型并将其整合到您自己的项目中,随后再根据您的特定需求进行微调,以获得最佳性能。</p><h3 data-block-key="4cu9q"><br/><b>安装 KerasHub</b></h3><p data-block-key="8btr5">要使用 Keras 3 安装最新的 KerasHub 版本,只需运行以下内容:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="shell"><span></span>$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>--upgrade<span class="w"> </span>keras-hub </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">现在,您可以开始探索可用的模型。为开始使用 Keras 3 设置的标准环境同样完全适用于开始使用 KerasHub:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">os</span> <span class="c1"># 定义要使用的 Keras 3 后端 - &quot;jax&quot;, &quot;tensorflow&quot; or &quot;torch&quot;</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">&quot;KERAS_BACKEND&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;jax&quot;</span> <span class="c1"># 导入 Keras 3 和 KerasHub 模块</span> <span class="kn">import</span> <span class="nn">keras</span> <span class="kn">import</span> <span class="nn">keras_hub</span> </pre></div> </div> <div class="inner-block-content rich-content"> <h2 data-block-key="u50tg">通过 KerasHub 使用计算机视觉和自然语言模型</h2><p data-block-key="728q8">现在,您可以从 KerasHub 开始访问和使用 Keras 3 生态系统中的模型。以下是一些示例:</p><h3 data-block-key="6b0r3"><b><br/>Gemma</b></h3><p data-block-key="87ia"><a href="https://ai.google.dev/gemma/docs/base">Gemma</a> 是由 Google 开发的一系列尖端且易于访问的开放模型。Gemma 的基础模型利用 Gemini 模型所用的研究成果和技术,擅长处理各种文本生成任务,其中包括回答问题、总结信息以及进行逻辑推理。此外,您还可以根据特定需求自定义模型。</p><p data-block-key="fgnpl">在此示例中,您可以使用 Keras 和 KerasHub 加载内容,并开始使用 Gemma2 2B 参数生成内容。有关 Gemma 变体的更多详细信息,请查看 Kaggle 上的 <a href="https://www.kaggle.com/models/google/gemma/">Gemma 模型卡</a>。</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="c1"># 从 Kaggle 模型加载 Gemma 2 2B 预设 </span> <span class="n">gemma_lm</span> <span class="o">=</span> <span class="n">keras_hub</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">GemmaCausalLM</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span><span class="s2">&quot;gemma_2b_en&quot;</span><span class="p">)</span> <span class="c1"># 开始利用 Gemma 2 2B 生成内容</span> <span class="n">gemma_lm</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span><span class="s2">&quot;Keras is a&quot;</span><span class="p">,</span> <span class="n">max_length</span><span class="o">=</span><span class="mi">32</span><span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <h3 data-block-key="u50tg"><b>PaliGemma</b></h3><p data-block-key="cj0hi"><a href="https://ai.google.dev/gemma/docs/paligemma">PaliGemma</a> 是一款紧凑型的开放模型,可以理解图像和文本。PaliGemma 由我们从 PaLI-3<a href="https://arxiv.org/abs/2310.09199"></a> 中汲取灵感开发而来,并以 <a href="https://arxiv.org/abs/2303.15343">SigLIP 视觉模型</a>和 <a href="https://arxiv.org/abs/2403.08295">Gemma 语言模型</a>等开源组件为基础,可以为有关图像的问题提供详细而有见地的答案。这样一来,该模型可以更深入地了解视觉内容,并具备为图像和短视频生成字幕、识别对象甚至阅读图像中的文本等功能。</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">os</span> <span class="c1"># 定义您要使用的 Keras 3 后端 - &quot;jax&quot;, &quot;tensorflow&quot; or &quot;torch&quot;</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">&quot;KERAS_BACKEND&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;jax&quot;</span> <span class="c1"># 导入 Keras 3 和 KerasHub 模块</span> <span class="kn">import</span> <span class="nn">keras</span> <span class="kn">import</span> <span class="nn">keras_hub</span> <span class="kn">from</span> <span class="nn">keras.utils</span> <span class="kn">import</span> <span class="n">get_file</span><span class="p">,</span> <span class="n">load_img</span><span class="p">,</span> <span class="n">img_to_array</span> <span class="c1"># 导入利用 224x224 图像微调的 PaliGemma 3B</span> <span class="n">pali_gemma_lm</span> <span class="o">=</span> <span class="n">keras_hub</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">PaliGemmaCausalLM</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span> <span class="s2">&quot;pali_gemma_3b_mix_224&quot;</span> <span class="p">)</span> <span class="c1"># 下载一张测试图像并准备将其用于 KerasHub</span> <span class="n">url</span> <span class="o">=</span> <span class="s1">&#39;https://storage.googleapis.com/keras-cv/models/paligemma/cow_beach_1.png&#39;</span> <span class="n">img_path</span> <span class="o">=</span> <span class="n">get_file</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="n">url</span><span class="p">)</span> <span class="n">img</span> <span class="o">=</span> <span class="n">img_to_array</span><span class="p">(</span><span class="n">load_img</span><span class="p">(</span><span class="n">image_path</span><span class="p">))</span> <span class="c1"># 利用关于图像的问题来创建提示。</span> <span class="n">prompt</span> <span class="o">=</span> <span class="s1">&#39;answer where is the cow standing?&#39;</span> <span class="c1"># 利用 PaliGemma 生成内容</span> <span class="n">output</span> <span class="o">=</span> <span class="n">pali_gemma_lm</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span> <span class="n">inputs</span><span class="o">=</span><span class="p">{</span> <span class="s2">&quot;images&quot;</span><span class="p">:</span> <span class="n">img</span><span class="p">,</span> <span class="s2">&quot;prompts&quot;</span><span class="p">:</span> <span class="n">prompt</span><span class="p">,</span> <span class="p">}</span> <span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">有关 Keras 3 上可用的预训练模型的更多详细信息,请在 Kaggle 上查看 <a href="https://www.kaggle.com/organizations/keras/models">Keras 中的模型列表</a>。</p><h3 data-block-key="fcv95"><br/><b>Stability.ai Stable Diffusion 3</b></h3><p data-block-key="56ia0">您也可以使用计算机视觉模型。例如,您可以结合使用 stability.ai <a href="https://stability.ai/news/stable-diffusion-3">Stable Diffusion 3</a> 与 KerasHub:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">from</span> <span class="nn">PIL</span> <span class="kn">import</span> <span class="n">Image</span> <span class="kn">from</span> <span class="nn">keras.utils</span> <span class="kn">import</span> <span class="n">array_to_img</span> <span class="kn">from</span> <span class="nn">keras_hub.models</span> <span class="kn">import</span> <span class="n">StableDiffusion3TextToImage</span> <span class="n">text_to_image</span> <span class="o">=</span> <span class="n">StableDiffusion3TextToImage</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span> <span class="s2">&quot;stable_diffusion_3_medium&quot;</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="mi">1024</span><span class="p">,</span> <span class="n">width</span><span class="o">=</span><span class="mi">1024</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="s2">&quot;float16&quot;</span><span class="p">,</span> <span class="p">)</span> <span class="c1"># 利用 SD3 生成图像</span> <span class="n">image</span> <span class="o">=</span> <span class="n">text_to_image</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span> <span class="s2">&quot;photograph of an astronaut riding a horse, detailed, 8k&quot;</span><span class="p">,</span> <span class="p">)</span> <span class="c1"># Display the generated image</span> <span class="n">img</span> <span class="o">=</span> <span class="n">array_to_img</span><span class="p">(</span><span class="n">image</span><span class="p">)</span> <span class="n">img</span> </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">有关 Keras 3 上可用的预训练计算机视觉模型的更多详细信息,请查看 <a href="https://keras.io/api/keras_hub/models/">Keras 中的模型列表</a>。</p><h2 data-block-key="6bgmm"><br/>对于 KerasNLP 开发者而言,有哪些变化?</h2><p data-block-key="b4vep">从 KerasNLP 过渡到 KerasHub 是一个简单的过程,只需将 import 语句从 <code>keras_nlp</code> 更新为 <code>keras_hub</code> 即可。</p><p data-block-key="8mod1">示例:以前,如果您需要导入 keras_nlp 才能使用 BERT 模型,如下所示</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">keras_nlp</span> <span class="c1"># 加载 BERT 模型 </span> <span class="n">classifier</span> <span class="o">=</span> <span class="n">keras_nlp</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">BertClassifier</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span> <span class="s2">&quot;bert_base_en_uncased&quot;</span><span class="p">,</span> <span class="n">num_classes</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">现在,您只需调整 import 即可使用 KerasHub:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">keras_hub</span> <span class="c1"># 加载 BERT 模型 </span> <span class="n">classifier</span> <span class="o">=</span> <span class="n">keras_hub</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">BertClassifier</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span> <span class="s2">&quot;bert_base_en_uncased&quot;</span><span class="p">,</span> <span class="n">num_classes</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <h2 data-block-key="u50tg">对于 KerasCV 开发者而言,有哪些变化?</h2><p data-block-key="deqts">如果您当前是 KerasCV 用户,更新到 KerasHub 将为您带来以下好处:</p><p data-block-key="4blku"></p><ul><li data-block-key="8g3j5"><b>简化模型加载:</b>KerasHub 为加载模型提供一致的 API,如果您同时使用 KerasCV 和 KerasNLP,则可以简化代码。</li></ul><p data-block-key="8nte9"></p><ul><li data-block-key="f8le9"><b>框架灵活性:</b>如果您有兴趣探索 JAX 或 PyTorch 等不同框架,KerasHub 可以让您更轻松地使用 KerasCV 和 KerasNLP 模型。</li></ul><p data-block-key="4mdot"></p><ul><li data-block-key="76h9c"><b>集中式存储区:</b>利用 KerasHub 的统一模型存储区,您可以更轻松地查找和访问模型,并在未来在其中添加新的架构。</li></ul><h3 data-block-key="e5gb4"><br/><b>如何使我的代码适应 KerasHub?</b></h3><h3 data-block-key="13otm">模型</h3><p data-block-key="107ui">目前,我们正在将 KerasCV 模型迁移到 KerasHub。虽然大多数模型已经可用,但有些仍在迁移中。请注意,<a href="https://www.kaggle.com/models/keras/centerpillar">Centerpillar 模型</a>不会被迁移。在 KerasHub 中,您可以通过输入以下内容来使用视觉模型:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">keras_hub</span> <span class="c1"># 使用预设加载模型</span> <span class="n">Model</span> <span class="o">=</span> <span class="n">keras_hub</span><span class="o">.</span><span class="n">models</span><span class="o">.&lt;</span><span class="n">model_name</span><span class="o">&gt;.</span><span class="n">from_preset</span><span class="p">(</span><span class="s1">&#39;preset_name`)</span> <span class="c1"># or load a custom model by specifying the backbone and preprocessor</span> <span class="n">Model</span> <span class="o">=</span> <span class="n">keras_hub</span><span class="o">.</span><span class="n">models</span><span class="o">.&lt;</span><span class="n">model_name</span><span class="o">&gt;</span><span class="p">(</span><span class="n">backbone</span><span class="o">=</span><span class="n">backbone</span><span class="p">,</span> <span class="n">preprocessor</span><span class="o">=</span><span class="n">preprocessor</span><span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">KerasHub 为 KerasCV 开发者引入了令人兴奋的新功能,从而提供了更大的灵活性和扩展功能。其中包括:</p><h3 data-block-key="fela8"><br/>内置预处理</h3><p data-block-key="6sjsv">每个模型都附带一个定制的预处理器,可解决常规任务,包括调整大小、重新缩放等,从而简化工作流。</p><p data-block-key="ai30i">在此之前,输入预处理是在向模型提供输入之前手动执行的。</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="c1"># 预处理输入示例</span> <span class="k">def</span> <span class="nf">preprocess_inputs</span><span class="p">(</span><span class="n">image</span><span class="p">,</span> <span class="n">label</span><span class="p">):</span> <span class="c1"># 重新调整大小或对输入进行更多预处理</span> <span class="k">return</span> <span class="n">preprocessed_inputs</span> <span class="n">backbone</span> <span class="o">=</span> <span class="n">keras_cv</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">ResNet50V2Backbone</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span> <span class="s2">&quot;resnet50_v2_imagenet&quot;</span><span class="p">,</span> <span class="p">)</span> <span class="n">model</span> <span class="o">=</span> <span class="n">keras_cv</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">ImageClassifier</span><span class="p">(</span> <span class="n">backbone</span><span class="o">=</span><span class="n">backbone</span><span class="p">,</span> <span class="n">num_classes</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="p">)</span> <span class="n">output</span> <span class="o">=</span> <span class="n">model</span><span class="p">(</span><span class="n">preprocessed_input</span><span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">目前,任务模型的预处理已集成到确定的预设中。预处理器会对输入进行预处理并对样本图像进行大小调整和重新缩放。虽然预处理器是任务模型的固有组件,但开发者仍然可以选择使用个性化的预处理器。</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="n">classifier</span> <span class="o">=</span> <span class="n">keras_hub</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">ImageClassifier</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span><span class="s1">&#39;resnet_18_imagenet&#39;</span><span class="p">)</span> <span class="n">classifier</span><span class="o">.</span><span class="n">predict</span><span class="p">(</span><span class="n">inputs</span><span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <h3 data-block-key="u50tg">损失函数</h3><p data-block-key="5qhd">与增强层类似,以前在 KerasCV 中使用的损失函数现在可在 Keras 中通过 <code>keras.losses.&lt;loss_function&gt;</code> 进行使用。例如,如果您当前正在使用 <a href="https://keras.io/api/keras_cv/losses/focal_loss/">FocalLoss 函数</a>:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">keras</span> <span class="kn">import</span> <span class="nn">keras_cv</span> <span class="n">keras_cv</span><span class="o">.</span><span class="n">losses</span><span class="o">.</span><span class="n">FocalLoss</span><span class="p">(</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.25</span><span class="p">,</span> <span class="n">gamma</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">from_logits</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">label_smoothing</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span> <span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">您只需要调整损失函数定义代码即可使用 <code>keras.losses</code> 而不是 <code>keras_cv.losses</code>:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">keras</span> <span class="n">keras</span><span class="o">.</span><span class="n">losses</span><span class="o">.</span><span class="n">FocalLoss</span><span class="p">(</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.25</span><span class="p">,</span> <span class="n">gamma</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">from_logits</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">label_smoothing</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span> <span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <h2 data-block-key="u50tg"><b>开始使用 KerasHub</b></h2><p data-block-key="e16fi">立即深入了解 KerasHub:</p><p data-block-key="e3thf"></p><ul><li data-block-key="22sc3"><b>开始使用文档:</b><a href="https://keras.io/keras_hub/">https://keras.io/keras_hub/</a></li></ul><p data-block-key="3nqt6"></p><ul><li data-block-key="bsh6s"><b>查看 KerasHub 入门指南:</b><a href="https://keras.io/guides/keras_hub/">https://keras.io/guides/keras_hub/</a></li></ul><p data-block-key="56fd8"></p><ul><li data-block-key="atjro"><b>试用预训练模型:</b><a href="https://keras.io/api/keras_hub/models/">https://keras.io/api/keras_hub/models/</a></li></ul><p data-block-key="dqjhr"></p><ul><li data-block-key="6vhaq"><b>探索源代码并做出贡献:</b><a href="https://github.com/keras-team/keras-hub/">https://github.com/keras-team/keras-hub/</a></li></ul><p data-block-key="elc5i"></p><ul><li data-block-key="19vfn"><b>了解 Kaggle 上的 Keras:</b><a href="https://www.kaggle.com/organizations/keras">https://www.kaggle.com/organizations/keras</a></li></ul><p data-block-key="3adku"><br/>加入 Keras 社区,释放统一、可访问和高效深度学习模型的力量。AI 未来的发展方向是多模态 AI,KerasHub 便是通往多模态 AI 的门户!</p> </div> </div> </section> <section class="navigation-container glue-page glue-spacer-6-top"> <div class="posted-in-section"> <div class="posted-in-section__heading"> <span class="glue-caption"> 发布于: </span> </div> <div class="posted-in-section__tags"> <ul> <li> <a href="/zh-hans/search/?product_categories=Gemma" class="glue-caption">Gemma</a> </li> <li> <a href="/zh-hans/search/?technology_categories=AI" class="glue-caption">AI</a> </li> <li> <a href="/zh-hans/search/?content_type_categories=Announcements" class="glue-caption">Announcements</a> </li> <li> <a href="/zh-hans/search/?content_type_categories=Best+Practices" class="glue-caption">Best Practices</a> </li> <li> <a href="/zh-hans/search/?tag=Keras" class="glue-caption">Keras</a> </li> <li> <a href="/zh-hans/search/?tag=Learn" class="glue-caption">Learn</a> </li> <li> <a href="/zh-hans/search/?tag=multimodal" class="glue-caption">multimodal</a> </li> <li> <a href="/zh-hans/search/?tag=PaliGemma" class="glue-caption">PaliGemma</a> </li> <li> <a href="/zh-hans/search/?tag=quantization" class="glue-caption">quantization</a> </li> <li> <a href="/zh-hans/search/?tag=Stable Diffusion" class="glue-caption">Stable Diffusion</a> </li> <li> <a href="/zh-hans/search/?tag=multi-host training" class="glue-caption">multi-host training</a> </li> <li> <a href="/zh-hans/search/?tag=deep learning" class="glue-caption">deep learning</a> </li> <li> <a href="/zh-hans/search/?tag=fine-tuning" class="glue-caption">fine-tuning</a> </li> <li> <a href="/zh-hans/search/?tag=LoRA" class="glue-caption">LoRA</a> </li> </ul> </div> </div> <div class="buttons-section"> <div class="buttons-section__left"> <a href="/zh-hans/evolving-the-responsible-generative-ai-toolkit-with-new-tools-for-every-llm/" class="glue-button--icon glue-elevation-level-1 " aria-label="上一页"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#chevron-left"></use> </svg> </a> <span class="caption ">上一页</span> </div> <div class="buttons-section__right"> <span class="caption ">下一步</span> <a href="/zh-hans/compare-mode-in-google-ai-studio/" class="glue-button--icon glue-elevation-level-1 " aria-label="下一步"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#chevron-right"></use> </svg> </a> </div> </div> </section> <section class="related-posts-container glue-page glue-spacer-6-top glue-spacer-3-bottom"> <span class="glue-headline glue-headline--headline-3">相关博文</span> <div class="related-posts-container__carousel glue-page glue-spacer-5-top"> <div class="glue-carousel glue-carousel--cards glue-carousel-related-posts" aria-label="相关博文"> <!-- Previous --> <button class="glue-carousel__button glue-carousel__button--prev" aria-label="转至上一张幻灯片"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--32px"> <use href="/glue-icon/#chevron-left"></use> </svg> </button> <!-- Next --> <button class="glue-carousel__button glue-carousel__button--next" aria-label="转至下一张幻灯片"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--32px"> <use href="/glue-icon/#chevron-right"></use> </svg> </button> <!-- List --> <div class="glue-carousel__viewport"> <div class="glue-carousel__list"> <a class="glue-card glue-carousel__item" href="/zh-hans/7-examples-of-geminis-multimodal-capabilities-in-action/"> <div aria-label="7 examples of Gemini’s multimodal capabilities in action" class="glue-card__inner"> <picture class="glue-card__asset"> <img alt="7 examples of Gemini’s multimodal capabilities in action" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Gemini-Vision-Feature_1.2e16d0ba.fill-800x400.png"> </picture> <div class="glue-card__content"> <div class="glue-card__tags glue-spacer-2-top"> <span class="glue-label">Gemini</span> <span class="glue-label">AI</span> <span class="glue-label">Announcements</span> <span class="glue-label">Industry Trends</span> </div> <p class="glue-headline glue-headline--headline-5">7 examples of Gemini’s multimodal capabilities in action</p> <div class="glue-card__cta-custom glue-spacer-3-top"> <span class="glue-cta">2024年11月25日</span> <svg aria-hidden="true" class="glue-icon glue-icon--24px" role="presentation"> <use href="/glue-icon/#arrow-forward"></use> </svg> </div> </div> </div> </a> <a class="glue-card glue-carousel__item" href="/zh-hans/advancing-multilingual-ai-with-gemma-2-and-a-150k-challenge/"> <div aria-label="迈向全球理解 – 借助 Gemma 2 和 15 万美元的挑战赛推进多语言 AI" class="glue-card__inner"> <picture class="glue-card__asset"> <img alt="迈向全球理解 – 借助 Gemma 2 和 15 万美元的挑战赛推进多语言 AI" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Gemma_2_J_Model_-_metadata2x.2e16d0ba.fill-800x400.png"> </picture> <div class="glue-card__content"> <div class="glue-card__tags glue-spacer-2-top"> <span class="glue-label">Gemma</span> <span class="glue-label">AI</span> <span class="glue-label">Announcements</span> </div> <p class="glue-headline glue-headline--headline-5">迈向全球理解 – 借助 Gemma 2 和 15 万美元的挑战赛推进多语言 AI</p> <div class="glue-card__cta-custom glue-spacer-3-top"> <span class="glue-cta">2024年10月3日</span> <svg aria-hidden="true" class="glue-icon glue-icon--24px" role="presentation"> <use href="/glue-icon/#arrow-forward"></use> </svg> </div> </div> </div> </a> <a class="glue-card glue-carousel__item" href="/zh-hans/join-us-at-the-women-in-ai-summit-2024/"> <div aria-label="Join us at the Women in AI Summit 2024!" class="glue-card__inner"> <picture class="glue-card__asset"> <img alt="Join us at the Women in AI Summit 2024!" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/WAI-2024-Feature.2e16d0ba.fill-800x400.png"> </picture> <div class="glue-card__content"> <div class="glue-card__tags glue-spacer-2-top"> <span class="glue-label">AI</span> <span class="glue-label">Community</span> <span class="glue-label">Events</span> </div> <p class="glue-headline glue-headline--headline-5">Join us at the Women in AI Summit 2024!</p> <div class="glue-card__cta-custom glue-spacer-3-top"> <span class="glue-cta">2024年11月22日</span> <svg aria-hidden="true" class="glue-icon glue-icon--24px" role="presentation"> <use href="/glue-icon/#arrow-forward"></use> </svg> </div> </div> </div> </a> <a class="glue-card glue-carousel__item" href="/zh-hans/introducing-the-google-developer-program-premium/"> <div aria-label="Introducing Google Developer Program premium membership" class="glue-card__inner"> <picture class="glue-card__asset"> <img alt="Introducing Google Developer Program premium membership" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Google-Developers-program-feature.2e16d0ba.fill-800x400.png"> </picture> <div class="glue-card__content"> <div class="glue-card__tags glue-spacer-2-top"> <span class="glue-label">Cloud</span> <span class="glue-label">Announcements</span> <span class="glue-label">Community</span> </div> <p class="glue-headline glue-headline--headline-5">Introducing Google Developer Program premium membership</p> <div class="glue-card__cta-custom glue-spacer-3-top"> <span class="glue-cta">2024年11月25日</span> <svg aria-hidden="true" class="glue-icon glue-icon--24px" role="presentation"> <use href="/glue-icon/#arrow-forward"></use> </svg> </div> </div> </div> </a> <a class="glue-card glue-carousel__item" href="/zh-hans/inference-with-gemma-using-dataflow-and-vllm/"> <div aria-label="使用 Dataflow 和 vLLM 对 Gemma 进行推理" class="glue-card__inner"> <picture class="glue-card__asset"> <img alt="使用 Dataflow 和 vLLM 对 Gemma 进行推理" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Gemma-Dataflow-ML-vLLM.2e16d0ba.fill-800x400.png"> </picture> <div class="glue-card__content"> <div class="glue-card__tags glue-spacer-2-top"> <span class="glue-label">Gemma</span> <span class="glue-label">AI</span> <span class="glue-label">Cloud</span> <span class="glue-label">How-To Guides</span> <span class="glue-label">Problem-Solving</span> </div> <p class="glue-headline glue-headline--headline-5">使用 Dataflow 和 vLLM 对 Gemma 进行推理</p> <div class="glue-card__cta-custom glue-spacer-3-top"> <span class="glue-cta">2024年11月13日</span> <svg aria-hidden="true" class="glue-icon glue-icon--24px" role="presentation"> <use href="/glue-icon/#arrow-forward"></use> </svg> </div> </div> </div> </a> </div> </div> <!-- Navigation dots --> <div class="glue-carousel__navigation" aria-label="Choose a page" data-glue-carousel-navigation-label="Selected tab $glue_carousel_page_number$ of $glue_carousel_page_total$"> </div> </div> </div> </section> </div> <div class="footer-linkboxes__wrapper"> <nav class="footer-linkboxes" aria-label="页脚链接"> <ul class="footer-linkboxes__list"> <li class="footer-linkbox"> <span class="footer-linkbox-heading"> 交流互动 </span> <ul class="footer-linkbox-list"> <li class="footer-linkbox-list__item"> <a href="//googledevelopers.blogspot.com" class="footer-linkbox-list__link"> Blog </a> </li> <li class="footer-linkbox-list__item"> <a href="https://goo.gle/googlefordevs" class="footer-linkbox-list__link"> Instagram </a> </li> <li class="footer-linkbox-list__item"> <a href="https://goo.gle/gdevs-li" class="footer-linkbox-list__link"> LinkedIn </a> </li> <li class="footer-linkbox-list__item"> <a href="https://goo.gle/gdevs-tw" class="footer-linkbox-list__link"> Twitter </a> </li> <li class="footer-linkbox-list__item"> <a href="https://goo.gle/developers" class="footer-linkbox-list__link"> YouTube </a> </li> </ul> </li> <li class="footer-linkbox"> <span class="footer-linkbox-heading"> 计划 </span> <ul class="footer-linkbox-list"> <li class="footer-linkbox-list__item"> <a href="//www.womentechmakers.com" class="footer-linkbox-list__link"> Women Techmakers </a> </li> <li class="footer-linkbox-list__item"> <a href="//developers.google.com/community/gdg" class="footer-linkbox-list__link"> Google Developer Groups </a> </li> <li class="footer-linkbox-list__item"> <a href="//developers.google.com/community/experts" class="footer-linkbox-list__link"> Google Developer Experts </a> </li> <li class="footer-linkbox-list__item"> <a href="//developers.google.com/community/accelerators" class="footer-linkbox-list__link"> Accelerators </a> </li> <li class="footer-linkbox-list__item"> <a href="//developers.google.com/community/gdsc" class="footer-linkbox-list__link"> Google Developer Student Clubs </a> </li> </ul> </li> <li class="footer-linkbox"> <span class="footer-linkbox-heading"> 开发者控制台 </span> <ul class="footer-linkbox-list"> <li class="footer-linkbox-list__item"> <a href="//console.developers.google.com" class="footer-linkbox-list__link"> Google API Console </a> </li> <li class="footer-linkbox-list__item"> <a href="//console.cloud.google.com" class="footer-linkbox-list__link"> Google Cloud Platform Console </a> </li> <li class="footer-linkbox-list__item"> <a href="//play.google.com/apps/publish" class="footer-linkbox-list__link"> Google Play Console </a> </li> <li class="footer-linkbox-list__item"> <a href="//console.firebase.google.com" class="footer-linkbox-list__link"> Firebase Console </a> </li> <li class="footer-linkbox-list__item"> <a href="//console.actions.google.com" class="footer-linkbox-list__link"> Actions on Google Console </a> </li> <li class="footer-linkbox-list__item"> <a href="//cast.google.com/publish" class="footer-linkbox-list__link"> Cast SDK Developer Console </a> </li> <li class="footer-linkbox-list__item"> <a href="//chrome.google.com/webstore/developer/dashboard" class="footer-linkbox-list__link"> Chrome Web Store Dashboard </a> </li> </ul> </li> </ul> </nav> </div> <div class="footer-utility__wrapper"> <div> <nav class="footer-sites" aria-label="其他 Google 开发者网站"> <a href="https://developers.google.com/" class="site-logo-link" data-label="Site logo"> <img src="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/images/g-dev.svg" class="site-logo" alt="Google for Developers"> </a> <ul class="footer-sites-list"> <li class="footer-sites-item"> <a href="//developer.android.com" class="footer-sites-link"> Android </a> </li> <li class="footer-sites-item"> <a href="//developer.chrome.com/home" class="footer-sites-link"> Chrome </a> </li> <li class="footer-sites-item"> <a href="//firebase.google.com" class="footer-sites-link"> Firebase </a> </li> <li class="footer-sites-item"> <a href="//cloud.google.com" class="footer-sites-link"> Google Cloud Platform </a> </li> <li class="footer-sites-item"> <a href="//developers.google.com/products" class="footer-sites-link"> All products </a> </li> <li class="footer-sites-item"> <button aria-hidden="true" class="glue-cookie-notification-bar-control footer-sites-link"> Manage cookies </button> </li> </ul> </nav> <nav class="footer-utility-links"> <ul class="footer-utility-list"> <li class="footer-utility-item"> <a href="//developers.google.com/terms/site-terms" class="footer-utility-link"> 条款 </a> </li> <li class="footer-utility-item"> <a href="//policies.google.com/privacy" class="footer-utility-link"> 隐私权 </a> </li> </ul> <div class="language-selector footer" aria-label="选择您的语言偏好"> <button type="button" aria-controls="lang-selector-footer" aria-haspopup="true"> <svg role="presentation" aria-hidden="true" class="glue-icon lang-icon"> <use href="/glue-icon/#language"></use> </svg> <span class="lang-label">简体中文</span> <svg role="presentation" aria-hidden="true" class="glue-icon lang-icon"> <use href="/glue-icon/#arrow-drop-down"></use> </svg> </button> <div id="lang-selector-footer" class="lang-menu hidden" role="menu"> <ul role="presentation"> <li role="presentation"> <a role="menuitem" lang="en" href="/en/introducing-keras-hub-for-pretrained-models/">English</a> </li> <li role="presentation"> <a role="menuitem" lang="es" href="/es/introducing-keras-hub-for-pretrained-models/">Español (Latam)</a> </li> <li role="presentation"> <a role="menuitem" lang="id" href="/id/introducing-keras-hub-for-pretrained-models/">Bahasa Indonesia</a> </li> <li role="presentation"> <a role="menuitem" lang="ja" href="/ja/introducing-keras-hub-for-pretrained-models/">日本語</a> </li> <li role="presentation"> <a role="menuitem" lang="ko" href="/ko/introducing-keras-hub-for-pretrained-models/">한국어</a> </li> <li role="presentation"> <a role="menuitem" lang="pt-br" href="/pt-br/introducing-keras-hub-for-pretrained-models/">Português (Brasil)</a> </li> <li role="presentation"> <a role="menuitem" lang="zh-hans" aria-current="true" href="/zh-hans/introducing-keras-hub-for-pretrained-models/">简体中文</a> </li> </ul> </div> </div> </nav> </div> </div> <script src="https://www.youtube.com/player_api"></script> <script src="//www.gstatic.com/glue/v27_1/glue.min.js"></script> <script type="text/javascript" src="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/js/dgc_blog.js"></script> <script src="https://www.gstatic.com/glue/cookienotificationbar/cookienotificationbar.min.js" data-glue-cookie-notification-bar-category="2A" data-glue-cookie-notification-bar-site-id="developers.googleblog.com"> </script> <script src="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/js/blog_detail.js"></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10