我想从这里试试通用句子编码器link
以下是我在Ubuntu 18.04和Jupyter Notebook上运行的代码
import tensorflow as tf
import tensorflow_hub as hub
embed = hub.Module("https://tfhub.dev/google/universal-sentence-encoder/2")
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(session.run(embeddings))它一直在运行,什么也没发生。它在下载什么吗?我已经等了很长时间了。它不会显示以下内容以外的任何内容:
WARNING: Logging before flag parsing goes to stderr.
W0517 09:23:47.724080 139743818422080 __init__.py:56] Some hub symbols are not available because TensorFlow version is less than 1.14我检查了我的tensorflow安装。看起来很好。有任何故障排除建议吗?
发布于 2019-05-24 17:13:15
你很好。此错误消息涉及仅对在TensorFlow 2中使用TF集线器很重要的符号,特别是hub.KerasLayer。已建立的TF1.x用法运行良好。
代码已经提交(但还没有被常规的Hub发布),以切换到不那么令人担忧的措辞。很抱歉给你造成了混乱。
https://stackoverflow.com/questions/56188525
复制相似问题