解决 AttributeError: module 'tensorflow.python.ops.variable_scope' has no attribute '_VARSCOPE_KEY'

在学习 Knifey-Spoony数据集上做分类的神经网络。它将Inception模型得到的transfer-values作为输入,运行报如下两个错

/usr/local/lib/python3.5/dist-packages/prettytensor/scopes.py in var_and_name_scope(names)

53         full_name = var_scope.name

54

---> 55       vs_key = tf.get_collection_ref(variable_scope._VARSCOPE_KEY)

56       try:

57         # TODO(eiderman): Remove this hack or fix the full file.

AttributeError: module 'tensorflow.python.ops.variable_scope' has no attribute '_VARSCOPE_KEY'

修改tf.get_collection_ref(variable_scope._VARSCOPE_KEY)

未 tf.get_collection_ref(variable_scope._VARSCOPESTORE_KEY)

/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/variable_scope.py in get_variable_scope()

1347 def get_variable_scope():

1348   """Returns the current variable scope."""

-> 1349   return get_variable_scope_store().current_scope

AttributeError: 'VariableScope' object has no attribute 'current_scope'

在如下 加入  写错了 

def _get_unique_variable_scope(prefix):

"""Get a name with the given prefix unique in the current variable scope."""

var_scope_store = get_variable_scope_store()

 current_scope = get_variable_scope()

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。