解决 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()

评论 23
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值