Open Meredith98 opened 3 years ago
Hi Meredith98, Please save the ### adv ### Variable after line 353 in myGetAdv.py files. The adv images are created from lines 343 to 352.
You may also want to replace line 307 adv_method = 'hdm' with adv_method = 'cbwm' to use the method mentioned in our paper.
Please let me know if you have any questions.
I just download the snapshot and save_for_load. Then I run myGetAdv.py, but why I can't get any pictures? Following is all I get after running myGetAdv.py, could u please tell what should I do to get the same results with u?
E:\anaconda3\python.exe C:/Users/Administrator/Desktop/机器学习/HashStash-master/HashNet/pytorch/src/myGetAdv.py Files already downloaded and verified Files already downloaded and verified E:\anaconda3\lib\site-packages\torch\nn\modules\loss.py:96: UserWarning: Using a target size (torch.Size([48])) that is different to the input size (torch.Size([1, 48])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size. return F.l1_loss(input, target, reduction=self.reduction) ...non-targeted iterative FGSM begin.... initial distance 0.0 epoch 0 loss: 0.31584808 Hamming distance: 0.0 epoch 1 loss: 1.110921 Hamming distance: 29.0 epoch 2 loss: 1.2478293 Hamming distance: 27.0 Final Hamming distance : 34.0 Original Image: [[ 72 4854 4 6 3 3 8 1 81 227]] [5259] Original Code Difference: [[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
Process finished with exit code 0