Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some question about the white box attack #10

Open
yuese1234 opened this issue Oct 14, 2024 · 4 comments
Open

some question about the white box attack #10

yuese1234 opened this issue Oct 14, 2024 · 4 comments
Assignees

Comments

@yuese1234
Copy link

Sorry to bother you again.
When I run your white-box attack code for LLaVA, the gradient is None. The specific problem is:
adv_noise.data = (adv_noise.data - alpha * adv_noise.grad.detach().sign()).clamp(0, 1)
AttributeError: 'NoneType' object has no attribute 'detach'. Can you give me some help?

@pyogher
Copy link
Collaborator

pyogher commented Nov 11, 2024

Hi @yuese1234, could you please provide your versions of torch and transformers? Alternatively, you can use transformers 4.36.2 and torch 2.1.0.

@yuese1234
Copy link
Author

Hi @yuese1234, could you please provide your versions of torch and transformers? Alternatively, you can use transformers 4.36.2 and torch 2.1.0.

I use the transformers 4.37.2 and torch 2.1.2。I found that in the VIT of CLIP, the gradient disappeared, but I rewrote a piece of code and loaded the VIT separately, and the gradient existed.

@pyogher
Copy link
Collaborator

pyogher commented Nov 11, 2024

Hi @yuese1234, could you please provide your versions of torch and transformers? Alternatively, you can use transformers 4.36.2 and torch 2.1.0.

I use the transformers 4.37.2 and torch 2.1.2。I found that in the VIT of CLIP, the gradient disappeared, but I rewrote a piece of code and loaded the VIT separately, and the gradient existed.

Ok, we will update the version requirements in the README later. Please let us know if you have any other questions.

@yuese1234
Copy link
Author

Hi @yuese1234, could you please provide your versions of torch and transformers? Alternatively, you can use transformers 4.36.2 and torch 2.1.0.

I use the transformers 4.37.2 and torch 2.1.2。I found that in the VIT of CLIP, the gradient disappeared, but I rewrote a piece of code and loaded the VIT separately, and the gradient existed.

Ok, we will update the version requirements in the README later. Please let us know if you have any other questions.

I just try transformers 4.36.2 and torch 2.1.0. the gradient is still None. As the follows:
images.requires_grad=True
image_features = self.encode_images(images)
print(f'image_features:{image_features.requires_grad}') the result is False . so crazy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants