赞
踩
1.安装tensorflow-hub: 使用pip或者anaconda都可以
命令:pip install tensorflow-hub
conda install tensorflow-hub
2.官网上的信息更新不及时,gitbub上的比较新,地址:https://github.com/tensorflow/hub
tf-hub在tf1和tf2中的使用方式不同,
在tf2.0中只能使用hub.load()(其实是tf.saved_model.load()的封装)和hub.KerasLayer(方便在Keras模型中使用)
3.使用语法简单:
handle = "https://hub.tensorflow.google.cn/google/imagenet/mobilenet_v2_050_96/feature_vector/4"
m = hub.load(handle)
result = m(input_tensor)
4. tf-hub使用连接下载模型文件存放在 "C:\Users\Administrator\AppData\Local\Temp\tfhub_modules\"
5.tf-hub官网:https://hub.tensorflow.google.cn/。如果使用的tensorflow版本是2.0 则需要选在对应版本可用的模型
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。