Skip to content
New issue

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

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

Already on GitHub? # to your account

shape mismatch #1

Open
Uooga opened this issue Apr 18, 2020 · 0 comments
Open

shape mismatch #1

Uooga opened this issue Apr 18, 2020 · 0 comments

Comments

@Uooga
Copy link

Uooga commented Apr 18, 2020

Hello, an error occurs when running this code. It seems the shape of the left side remains the shape (Batch_size, channel ,W,H) while the right is [mask.shape(0),C,H,W)
Looking forward to your reply, thanks!
Traceback (most recent call last):
File "kwta_attack.py", line 188, in
perturbations, correct = gradient_estimator_pgd(images, labels)
File "kwta_attack.py", line 165, in gradient_estimator_pgd
_deltas[mask.numpy()] = (deltas[mask] - lr * grads.sign()).numpy()
ValueError: shape mismatch: value array of shape (145,3,32,32) could not be broadcast to indexing result of shape (200,3,32,32)

@Uooga Uooga changed the title 'Tensor' object has no attribute 'ndim' shape mismatch May 4, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant