tensorflow hubs 如何load本地的模型
一是防止远程被墙;
二是使用本地下载的模型;
print("=========Load Remote hub model:hub.KerasLayer =============")
##防止远程被墙
#tfhub_bert="https://tfhub.dev/tensorflow/small_bert/bert_en_uncased_L-2_H-128_A-2/1"
tfhub_bert="https://storage.googleapis.com/tfhub-modules/tensorflow/small_bert/bert_en_uncased_L-2_H-128_A-2/1.tar.gz"
bert_layer = hub.KerasLayer(tfhub_bert,trainable=False)
print("=========Load Remote hub model:hub.KerasLayer, success!=============")