From d42ec080f733d37a8eee7430df868c2ffc95b319 Mon Sep 17 00:00:00 2001 From: Darren Date: Thu, 6 Sep 2018 22:43:53 -0700 Subject: [PATCH] merge darren, jay --- YOLO_tiny_tf_attack.py | 16 +++++++--------- __pycache__/transformation.cpython-36.pyc | Bin 7222 -> 7222 bytes 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/YOLO_tiny_tf_attack.py b/YOLO_tiny_tf_attack.py index c4b76a2..8ef7586 100644 --- a/YOLO_tiny_tf_attack.py +++ b/YOLO_tiny_tf_attack.py @@ -53,6 +53,7 @@ def argv_parser(self,argvs): def build_YOLO_attack_graph(self): if self.disp_console : print("Building YOLO attack graph...") + self.sample_matrixes = transformation.target_sample() # x is the image self.x = tf.placeholder('float32',[1,448,448,3]) self.musk = tf.placeholder('float32',[1,448,448,3]) @@ -77,15 +78,12 @@ def build_YOLO_attack_graph(self): ################################################# # build graph to compute the largest Cp among all pictures using the for loop # transform original picture over EOT - self.another_constrained = self.constrained*0.99 - pdb.set_trace() - ##### - - print(tf.AUTO_REUSE) - with tf.variable_scope("") as scope:# .reuse_variables() - scope.reuse_variables() - self.another_Cp = self.YOLO_model(self.another_constrained,mode="reuse_model") - self.max_Cp = tf.maximum(self.max_Cp,0) + for id, sample_matrix in enumerate(self.sample_matrixes): + self.another_constrained = tf.contrib.image.transform(self.constrained, sample_matrix) + with tf.variable_scope("") as scope:# .reuse_variables() + scope.reuse_variables() + self.another_Cp = self.YOLO_model(self.another_constrained,mode="reuse_model") + self.max_Cp = tf.maximum(self.max_Cp,0) ##### ################################################# # computer graph for norm 2 distance diff --git a/__pycache__/transformation.cpython-36.pyc b/__pycache__/transformation.cpython-36.pyc index cd445d9bd191e0f255d14739d0b65a98925cc758..ecdd27c9a41cf4c022792791da80e01129f5b86e 100644 GIT binary patch delta 16 XcmdmHvCV?rn3tC;o^R4dc6}KDC~5>f delta 16 XcmdmHvCV?rn3tEU%dLMSyS@wnD%b>_