问题产生的原因是当前Python使用的Tensorflow库为2.0最新版本,而源代码使用的是1.0版本,在不降低版本的情况下运行代码需要做些调整:
找到报错的地方,在报错的attribute前面加上compat.v1.
举例说明:
源码:注意这个tf
with tf.gfile.GFile(graph_filename, 'rb') as f:
更改后:
with tf.compat.v1.gfile.GFile(graph_filename, 'rb') as f:
contrib特殊处理,学习自这里
当报错为AttributeError: module ‘te