0

这是回溯:

 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。

4

1 回答 1

1

It looks like you're using Tensorflow, you want tf.compat.v1.GraphKeys, not GraphKey

于 2019-11-21T23:24:56.673 回答