我希望你们所有人都做得很好。我需要在 Windows 上为某些项目安装cleverhans,但是一旦安装它就无法访问其中的任何 python 文件,并且出现了很多错误,例如:
<ipython-input-12-4fbd91cef426> in <module>
10 import numpy as np
11
---> 12 from cleverhans.attacks import FastGradientMethod
13 from cleverhans.compat import flags
14 from cleverhans.dataset import MNIST
~\src\cleverhans\cleverhans\attacks\__init__.py in <module>
10
11 from cleverhans import utils
---> 12 from cleverhans.attacks.attack import Attack
13 from cleverhans.attacks.basic_iterative_method import BasicIterativeMethod
14 from cleverhans.attacks.carlini_wagner_l2 import CarliniWagnerL2
~\src\cleverhans\cleverhans\attacks\attack.py in <module>
11
12 from cleverhans.compat import reduce_max
---> 13 from cleverhans.model import Model
14 from cleverhans import utils
15
~\src\cleverhans\cleverhans\model.py in <module>
7 import tensorflow as tf
8
----> 9 from cleverhans import utils_tf
10
11
~\src\cleverhans\cleverhans\utils_tf.py in <module>
343
344 def kl_with_logits(p_logits, q_logits, scope=None,
--> 345 loss_collection=tf.GraphKeys.REGULARIZATION_LOSSES):
346 """Helper function to compute kl-divergence KL(p || q)
347 """
AttributeError: module 'tensorflow' has no attribute 'GraphKeys'
我希望能从你那里得到很多答案。祝你今天过得愉快。