The*_*ise 1 tensorflow-serving google-colaboratory tensorflow2.0
我训练用一个简单的模型MNIST tensorflow 2.0的谷歌Colab并在保存它以.json格式。单击此处以查看我在其中编写代码的Colab笔记本。然后在运行命令
!simple_tensorflow_serving --model_base_path="/" --model_platform="tensorflow"
它显示错误AttributeError:模块'tensorflow'没有属性'gfile'
simple_tensorflow_serving帮助轻松地将经过训练的张量流模型部署到生产中。
我使用的版本:
(1)TensorFlow-2.0
(2)simple_tensorflow_serving-0.6.4
先感谢您 :)
Jia*_*Kui 19
在 2.0 中,tf.gfile.* 替换为 tf.io.gfile.*。
当我收到错误时:
File "/Users/MRJ/anaconda3/envs/python37-tf2.1/lib/python3.7/
site-packages/object_detection/utils/label_map_util.py",
line 137, in load_labelmap
with tf.gfile.GFile(path, 'r') as fid:
AttributeError: module 'tensorflow' has no attribute 'gfile'
Run Code Online (Sandbox Code Playgroud)
1. 找到label_map_util.py
第 137 行。
2.替换tf.gfile.GFile
为tf.io.gfile.GFile
它对我有用。
Simple Tensorflow Serving is not ready for Tensorflow 2.0, since it is using the old API.
In Tensorflow 2.0 the gfile
package has been moved into tf.io
.
Then, you have to downgrade your Tensorflow instance to TF 1.13 use Simple Tensorflow Serving
归档时间: |
|
查看次数: |
1969 次 |
最近记录: |