如何在Azure ML中使用tensorflow集线器



我正在尝试在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'

要解决此ModuleNotFoundError: No module named 'tensorflow_hub'错误,请尝试以下方法:

  • 请尝试安装/升级最新版本的tensorflowtensorflow-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:没有名为"tensorflow_hub"的模块,没有名为"tensorflow_hub"的模块以及如何使用tensorflow hub模型?

最新更新