AttributeError:GraphKey

这是回溯:

 File "C:\tensorflow1\models\research\slim\nets\inception_resnet_v2.py",line 373,in <module>
    batch_norm_updates_collections=tf.compat.v1.GraphKey.UPDATE_OPS,AttributeError: module 'tensorflow._api.v1.compat.v1' has no attribute 'GraphKey'

代码如下:

def inception_resnet_v2_arg_scope(
    weight_decay=0.00004,batch_norm_decay=0.9997,batch_norm_epsilon=0.001,activation_fn=tf.nn.relu,batch_norm_updates_collections=tf.compat.v1.GraphKey.UPDATE_OPS,batch_norm_scale=False):

我尝试使用tf版本1和2。

xuexiaojuanxxj13400 回答:AttributeError:GraphKey

看起来您正在使用Tensorflow,您希望使用tf.compat.v1.GraphKeys,而不是GraphKey

本文链接:https://www.f2er.com/3054198.html

大家都在问