Skip to content

Commit 65536bf

Browse files
committed
Fixed issue with uint8
1 parent cd43223 commit 65536bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pgd_attack.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def perturb(self, x_nat, y, sess):
4747
x = x_nat + np.random.uniform(-self.epsilon, self.epsilon, x_nat.shape)
4848
x = np.clip(x, 0, 255) # ensure valid pixel range
4949
else:
50-
x = np.copy(x_nat)
50+
x = x_nat.astype(np.float)
5151

5252
for i in range(self.num_steps):
5353
grad = sess.run(self.grad, feed_dict={self.model.x_input: x,

0 commit comments

Comments
 (0)