英文:
Unable to load model from tensor flow
问题
我正在尝试从 TensorFlow 加载模型,但它不起作用。
以下是代码部分:
import tensorflow_hub as hub
print('before')
embed = hub.load("https://tfhub.dev/google/universal-sentence-encoder/4")
print('after')
embeddings = embed([
"The quick brown fox jumps over the lazy dog.",
"I am a sentence for which I would like to get its embedding"])
print(embeddings)
我没有收到错误消息,代码只是停在那里不运行。有任何帮助吗?
英文:
I am trying to load a model from tensor flow but its not working.
here is the code::
import tensorflow_hub as hub
print('before')
embed = hub.load("https://tfhub.dev/google/universal-sentence-encoder/4")
print('after')
embeddings = embed([
"The quick brown fox jumps over the lazy dog.",
"I am a sentence for which I would like to get its embedding"])
print(embeddings)
I dont get an error, the code just gets stuck and does not run.
any help
答案1
得分: 0
你的代码没有问题。
它在我的系统上运行正常。
模型的大小约为1GB,因此加载它需要一些时间(对我来说需要20-30秒)。
检查你的网络连接或尝试在其他系统上运行代码,比如Google Colab。
英文:
There is no problem in your code.<Br>
It work fine on my system.<br>
The size of the model is about 1GB, so it will take some time to load it (for me it takes 20-30 sec). Check your internet connectivity or you can try to run the code on other system like Google colab.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论