【发布时间】:2021-07-18 19:44:15
【问题描述】:
一种方法是每次从tensorflow_hub 下载模型,如下所示
import tensorflow as tf
import tensorflow_hub as hub
hub_url = "https://tfhub.dev/google/tf2-preview/nnlm-en-dim128/1"
embed = hub.KerasLayer(hub_url)
embeddings = embed(["A long sentence.", "single-word", "http://example.com"])
print(embeddings.shape, embeddings.dtype)
我想下载文件一次又一次地使用,而不是每次都下载
【问题讨论】:
标签: python tensorflow