Closed beiyanpiki closed 1 year ago
Thanks for catching! Fixed via 49675e30ed38b2518f7a1b85b667de5f4a0c9a7c
I found there is a commit that adds .cpu end of line 94, so I dont know it's a bug or something else
It's an intended behavior to save memory on GPU :)
Hello, I got some error when I run SG Attack's example code on cuda device:
I found
self.label
is on cuda device, butbest_wrong_label
is on cpu. https://github.com/EdisonLeeeee/GreatX/blob/73eac351fdae842dbd74967622bd0e573194c765/greatx/attack/targeted/sg_attack.py#L123-L124I remove line94
.cpu()
, everything is going well and no error reporthttps://github.com/EdisonLeeeee/GreatX/blob/73eac351fdae842dbd74967622bd0e573194c765/greatx/attack/targeted/sg_attack.py#L94-L96
I found there is a commit that adds
.cpu
end of line 94, so I dont know it's a bug or something else🤨