if self.default_graph is None:
error_string = "The attack symbolic graph was not generated."
raise Exception(error_string)
if self.nb_calls_generate > 1:
warnings.warn("Attack was generated symbolically multiple "
"times, using graph defined by first call.")
After Change
// Generate this attack"s graph if it hasn"t been done previously
if not hasattr(self, "_x"):
input_shape = list(X.shape)
input_shape[0] = None
self._x = tf.placeholder(tf.float32, shape=input_shape)
self._x_adv = self.generate(self._x)