You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
Uooga
changed the title
'Tensor' object has no attribute 'ndim'
shape mismatch
May 4, 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)
The text was updated successfully, but these errors were encountered: