如何在Azure ML中使用Tensorflow Hub

发布于 2025-01-21 11:09:53 字数 781 浏览 7 评论 0原文

我正在尝试在Azure ML Studio中使用TensorFlow Hub,

我正在使用内核Python 3.8 pt和tf,

并且我安装了一些模块:

!pip install bert-for-tf2
!pip install sentencepiece
!pip install "tensorflow>=2.0.0"
!pip install --upgrade tensorflow-hub

使用PIP列表,我可以看到它们已安装:

tensorflow                              2.8.0
tensorflow-estimator                    2.3.0
tensorflow-gpu                          2.3.0
tensorflow-hub                          0.12.0
tensorflow-io-gcs-filesystem            0.24.0

但是,当我尝试根据文档使用它时使用它。 ( https://www.tensorflow.org/hub

然后我得到经典:

ModuleNotFoundError: No module named 'tensorflow_hub'

I am trying to use TensorFlow Hub in Azure ML Studio

I am using the kernel Python 3.8 PT and TF

And I installed a few modules:

!pip install bert-for-tf2
!pip install sentencepiece
!pip install "tensorflow>=2.0.0"
!pip install --upgrade tensorflow-hub

With pip list, I can see they are installed:

tensorflow                              2.8.0
tensorflow-estimator                    2.3.0
tensorflow-gpu                          2.3.0
tensorflow-hub                          0.12.0
tensorflow-io-gcs-filesystem            0.24.0

However when I try to use it as per the documentation (https://www.tensorflow.org/hub)

Then I get the classic:

ModuleNotFoundError: No module named 'tensorflow_hub'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落在眉间の轻吻 2025-01-28 11:09:53

要解决此modulenotFoundError:no模块名为'tensorflow_hub'错误,请尝试以下方式:

  • 尝试安装/升级最新版本的tensorflow tensorflow-hub然后导入:
!pip install --upgrade tensorflow

!pip install --upgrade tensorflow_hub

import tensorflow as tf

import tensorflow_hub as hub
  • 将当前环境安装为新内核:
python3 -m ipykernel install --user --name=testenvironment

您可以参考 modulenotfoundError:> modulenotfounderror:没有名为“ tensorflow_hub'的模块,no模块名为'tensorflow_hub'

To resolve this ModuleNotFoundError: No module named 'tensorflow_hub' error, try following ways:

  • Try installing/upgrading the latest version of tensorflow and tensorflow-hub and then import:
!pip install --upgrade tensorflow

!pip install --upgrade tensorflow_hub

import tensorflow as tf

import tensorflow_hub as hub
  • Install the current environment as a new kernel:
python3 -m ipykernel install --user --name=testenvironment

You can refer to ModuleNotFoundError: No module named 'tensorflow_hub', No module named 'tensorflow_hub' and How to use Tensorflow Hub Model?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文