PatchAttack
PatchAttack copied to clipboard
The TPA code general picture in the same place with same patch, Is this normal?
the code I use is this ``configure_PA( t_name='/home/host/mounted2/imagenet-/TextureDict/TextureDict_ImageNet', t_labels = np.arange(1000).tolist(), area_occlu = 0.1, n_occlu = 1, rl_batch=500, steps=50, TPA_n_agents=4, ) TPA = PA.TPA(dir_title) criterion = torch.nn.CrossEntropyLoss() metric_logger = utils.MetricLogger(delimiter=" ") header = 'Test:' for images, target in metric_logger.log_every(data_loader, 1000, header): input_tensor = images.to(device, non_blocking=True) label_tensor = target.to(device, non_blocking=True) adv_img, rcd_list = TPA.attack( model = model, target = 723, input_tensor = input_tensor[0,:,:,:], label_tensor = label_tensor, )` I use dataloadr load data from imagenet-1k, the batch_size is 1 , so i use input_tensor[0,;.;.;] to get the picture and use for my model. But the TPA code general picture in the same place with same patch, could you help me about this? Thanks for your help