if "y" in kwargs and "y_target" in kwargs:
raise ValueError("Can not set both "y" and "y_target".")
elif "y" in kwargs:
labels = kwargs["y"]
elif "y_target" in kwargs:
labels = kwargs["y_target"]
After Change
from .attacks_tf import CarliniWagnerL2 as CWL2
self.parse_params(**kwargs)
labels, nb_classes = self.get_labels(x, kwargs)
attack = CWL2(self.sess, self.model, self.batch_size,
self.confidence, "y_target" in kwargs,
self.learning_rate, self.binary_search_steps,