Tensorflow Serving 部署自己的模型时遇到如下报错:
module ‘tensorflow’ has no attribute ‘reset_default_graph’
解决方案如下:
1,原本的代码
import tensorflow as tf #这行代码改成下面的两行代码
2,替换成如下代码:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
运行成功。
Reference
linkTensorFlow学习记录:用TensorFlow_Serving部署模型并进行远程使用
link module ‘tensorflow’ has no attribute ‘reset_default_graph’