Open WillBuyingFrog opened 2 years ago
Hi,
thanks for interest in our work! I think it's sufficient to modify https://github.com/fra31/sparse-rs/blob/21d875969a1455e4d5b26dcf32c843e6262d1f9c/rs_attacks.py#L572 to
new_clr = self.random_choice(new_clr.shape).clone().clamp(0., 1.)
If this solves your issue, I'll update the code too. Thanks for letting me know!
Thank you for your help! The program runs smoothly after 60% of attack_single_run()
.
Unfortunately, when attack_single_run()
returns, it still reports error:
It seems that n_queries
is not defined in patches_universal
part of the code. I tried to add the following line of code after line 538 like what frames_universal
implements:
n_queries = torch.ones_like(y).float()
After I added the code, the programs runs ok. The only concern is that the changes I made probably doesn't match the paper's algorithm(actually I'm quite new to research and I may miss something when reading papers). Could you please check my changes mentioned above?
Thank you again for your help!
I think it should be fine, for the universal attacks all queries should anyway be used for all points i.e. there's no early stopping. I'll update that as well, thanks!
Hello, The error
argument 'size' (position 1) must be tuple of ints, not Tensor
always occur at 60% progress of the funcitonattack_single_run()
when I tried to run the code with the following command:Where ../frogdata/ILSVRC2012_val is the path to the imagenet validation set.
The error reports is like:
I used the latest stable version of PyTorch at first. Then I tried to switch to PyTorch 1.8.0 and Python3.8.5 according to README.md in the repository, but that doesn't help, so I decided to post an issue here to seek for help.
Thank you for your fascinating work and any help given!