ffhibnese / CPGC_VLP_Universal_Attacks

Universal Adversarial Attack, Multimodal Adversarial Attacks, VLP models, Contrastive Learning, Cross-modal Perturbation Generator, Generative Attacks.
12 stars 0 forks source link

bug #1

Open TheLiao233 opened 1 month ago

TheLiao233 commented 1 month ago

Hello, thank you for your outstanding work and publishing the relevant code. I had some problems when I tried to use the command python train.py --config configs/Retrieval_flickr_train.yaml --source_model ViT-B/16 --source_ckpt '/media/nlp/data/tl/model/vit'to reproduce.

The following error occurred when I set os.environ["CUDA_VISIBLE_DEVICES"] = '0,1' to run

image

So change clamp_norm = torch.clamp(norm, self.min_norm, self.max_norm) to clamp_norm = torch.clamp(norm, self.min_norm.to(norm.device), self.max_norm.to(norm.device))

But then the following problem occurred, so I removed the self.methodfrom the loss_infoNCE = self.loss_func(adv_txt_embeds, img_embeds, txt2img, target_img_embeds, self.temperature,self.method)

image

Finally, I encountered the following problems, and then I tried to directly change loss.backward()to loss.backward(retain_graph=True), and finally the GPU memory overflowed, but no solution was found at present, I hope you can help me solve it, thank you very much!

image

ffhibnese commented 1 month ago

We're sorry about the bugs due to a busy schedule and did not carefully check the uploaded code. We will soon update the repository to correct existing issues. Thanks again for your attention and the reminder about these problems.

ffhibnese commented 1 month ago

Hello, thank you for your outstanding work and publishing the relevant code. I had some problems when I tried to use the command python train.py --config configs/Retrieval_flickr_train.yaml --source_model ViT-B/16 --source_ckpt '/media/nlp/data/tl/model/vit'to reproduce.

The following error occurred when I set os.environ["CUDA_VISIBLE_DEVICES"] = '0,1' to run

image

So change clamp_norm = torch.clamp(norm, self.min_norm, self.max_norm) to clamp_norm = torch.clamp(norm, self.min_norm.to(norm.device), self.max_norm.to(norm.device))

But then the following problem occurred, so I removed the self.methodfrom the loss_infoNCE = self.loss_func(adv_txt_embeds, img_embeds, txt2img, target_img_embeds, self.temperature,self.method)

image

Finally, I encountered the following problems, and then I tried to directly change loss.backward()to loss.backward(retain_graph=True), and finally the GPU memory overflowed, but no solution was found at present, I hope you can help me solve it, thank you very much!

image

Hello, Liao. We have fixed the minor bug and updated the code. Feel free to contact us if you have any further questions ~

TheLiao233 commented 1 month ago

Hello, thank you for your outstanding work and publishing the relevant code. I had some problems when I tried to use the command python train.py --config configs/Retrieval_flickr_train.yaml --source_model ViT-B/16 --source_ckpt '/media/nlp/data/tl/model/vit'to reproduce. The following error occurred when I set os.environ["CUDA_VISIBLE_DEVICES"] = '0,1' to run image So change clamp_norm = torch.clamp(norm, self.min_norm, self.max_norm) to clamp_norm = torch.clamp(norm, self.min_norm.to(norm.device), self.max_norm.to(norm.device)) But then the following problem occurred, so I removed the self.methodfrom the loss_infoNCE = self.loss_func(adv_txt_embeds, img_embeds, txt2img, target_img_embeds, self.temperature,self.method) image Finally, I encountered the following problems, and then I tried to directly change loss.backward()to loss.backward(retain_graph=True), and finally the GPU memory overflowed, but no solution was found at present, I hope you can help me solve it, thank you very much! image

Hello, Liao. We have fixed the minor bug and updated the code. Feel free to contact us if you have any further questions ~

Thank you very much for your reply, but when I run train.py on ubuntu 24.04 with 2 RTX A6000 and 128G cpu memory,It often gets stuck at about one-third and causes the computer to freeze. What could be the reason? Could it be that the Flickr30k dataset is too large?

ffhibnese commented 1 month ago

Hello, thank you for your outstanding work and publishing the relevant code. I had some problems when I tried to use the command python train.py --config configs/Retrieval_flickr_train.yaml --source_model ViT-B/16 --source_ckpt '/media/nlp/data/tl/model/vit'to reproduce. The following error occurred when I set os.environ["CUDA_VISIBLE_DEVICES"] = '0,1' to run image So change clamp_norm = torch.clamp(norm, self.min_norm, self.max_norm) to clamp_norm = torch.clamp(norm, self.min_norm.to(norm.device), self.max_norm.to(norm.device)) But then the following problem occurred, so I removed the self.methodfrom the loss_infoNCE = self.loss_func(adv_txt_embeds, img_embeds, txt2img, target_img_embeds, self.temperature,self.method) image Finally, I encountered the following problems, and then I tried to directly change loss.backward()to loss.backward(retain_graph=True), and finally the GPU memory overflowed, but no solution was found at present, I hope you can help me solve it, thank you very much! image

Hello, Liao. We have fixed the minor bug and updated the code. Feel free to contact us if you have any further questions ~

Thank you very much for your reply, but when I run train.py on ubuntu 24.04 with 2 RTX A6000 and 128G cpu memory,It often gets stuck at about one-third and causes the computer to freeze. What could be the reason? Could it be that the Flickr30k dataset is too large?

Sorry, we didn't not came across this issue in our experiments. Maybe you can take another GPU server to run the code.